This topic explains how you can use the
ld-find-code-refs utility with CircleCi to automatically populate code references in LaunchDarkly.
To complete this procedure, you must have the following prerequisites:
Circle Workflow version 2.1 or higher is required
To use CircleCI Orbs, you must be using a Circle Workflow version of 2.1 or higher.
If you're using an earlier version, try manually using the utility binary or docker image to create your own workflow job.
To set up the LaunchDarkly orb in CircleCI:
- Save your personal API access token as an environment variable titled
LD_ACCESS_TOKENin your CircleCI project settings. To learn more, read CircleCI's documentation.
- Create a YAML file in CircleCI with configuration including LaunchDarkly's Orb.
Here's an example minimal configuration using LaunchDarkly's Orb:
version2.1 orbs firstname.lastname@example.org workflows main jobs launchdarkly/find-code-references proj_key$YOUR_LAUNCHDARKLY_PROJECT_KEY repo_typegithub # can be 'github', 'bitbucket', or 'custom' repo_url$YOUR_REPO_URL # used to generate links to your repository in the LaunchDarkly webapp
You can learn more about configuration options in CircleCI's documentation. To learn more, read Explore Orbs / launchdarkly/ld-find-code-refs.