The Bitbucket Pipelines integration is only available to customers on select plans. To learn more, read about our pricing. To upgrade your plan, contact Sales.
This topic explains how to create and enable feature flags using Bitbucket Pipelines.
The LaunchDarkly integration lets you insert feature flag actions directly into your Pipeline’s continuous delivery flow. Bitbucket Pipelines is a continuous delivery platform that lets your team build, test, and deploy from Bitbucket. It exists within Bitbucket, giving you end-to-end visibility from coding to deployment.
We provide two scripts you can add to your pipelines:
To use the LaunchDarkly Bitbucket Pipelines integration, you must meet the following prerequisites:
You can configure a Bitbucket Pipeline step to create a set of feature flags in LaunchDarkly as part of your build process.
To set up your Bitbucket Pipeline with LaunchDarkly:
create-launchdarkly-flags.sh shell script from our Bitbucket repository.create-launchdarkly-flags.sh to your Pipelines build configuration.LAUNCHDARKLY_ACCESS_TOKEN: Copy your API access token from the Authorizations tab within Account settings.LAUNCHDARKLY_PROJECT_KEY: Copy your project key from your LaunchDarkly Projects tab within Account settings.
Be careful to use the LaunchDarkly project key in the Bitbucket Pipelines settings, not the environment key. To learn how to find your project key, read Project keys.
ld-flags.conf file to your repository and declare flags in it.When your Pipelines build runs, any feature flags you declare in this file is also created in LaunchDarkly.
You can configure a Pipeline step that enables an existing feature flag in an environment as part of your build.
To enable feature flags with Bitbucket Pipelines:
enable-launchdarkly-flags.sh shell script from our Bitbucket repository.enable-launchdarkly-flags.sh to your Pipelines build configuration.LAUNCHDARKLY_ACCESS_TOKEN: Copy your API access token from the Authorization tab.LAUNCHDARKLY_PROJECT_KEY: To learn how to find your project key, read Project keys.LAUNCHDARKLY_ENVIRONMENT_KEY: Copy your environment key from your LaunchDarkly Projects tab.LAUNCHDARKLY_FLAG_KEY: Enter the key for the feature flag you wish to enable.