Feature Flags and GitOps
Connecting to GitHub Cloud
- Create an empty repository named feature-flags-configuration-as-code in your workshop GitHub Organization.
- Connect the CloudBees Feature Management app into the Github repository by:
- Going to App Settings > Integrations tab (from the left Panel) in the CloudBees Feature Management dashboard.
- Click the Connect button in the GitHub panel.
- In GitHub, select your workshop GitHub Organization to integrate with CloudBees Feature Management GitHub app. On the next screen select the Only select repositories and then select the feature-flags-configuration-as-code repository you just created.
- After clicking the Install button you will be redirected back to the CloudBees Feature Management dashboard to select your app and the repository you just created.
- Click Connect and you are done integrating CloudBees Feature Management with GitHub.
Using CasC and GitOps
- In the CloudBees Feature Management dashboard, disable the sidebar experiment in Development environment by toggling targeting from On to Off.
- In GitHub, navigate to your feature-flags-configuration-as-code repository and note the structure. You should see an automatically generated README.md and a target_groups directory.
- Switch from master branch to the automatically created Development branch and note the differences. Note the existence of an experiments folder that contains default.sidebar.yml with enabled: false on line 3.
Within the GitHub code editor, modify default.sidebar.yml by editing the line enabled: false to become enabled: true and commit to Development branch. Your YAML should closely resemble this:
In the CloudBees Feature Management dashboard, notice that your default.sidebar configuration has been reactivated in the Development environment.
Now that you are satisfied with the configuration in your Development environment, you want to include this experiment in your Production environment. In Github, merge the Development branch to main branch by creating and merging a pull request. Make sure not to delete the Development branch after confirming the merge.
In CloudBees Feature Management dashboard, note the sidebar and title experiments have now added to your Production environment.
Lab 5 Completed!
Congratulations! You have finished the fifth and final lab!