For instructor led workshops please go to the workshop slides before proceeding with this lab: https://cloudbees-days.github.io/cloudbees-field-workshops/cloudbees-feature-management/#1
In this lab, you will set up a CloudBees Feature Management account and use it to manage feature flags through remote configurations created in the CloudBees Feature Management dashboard.
The CloudBees CI Pipeline that will automatically build and deploy your mircroblog-frontend
application uses a different CloudBees Feature Management environment key depending on which branch is deployed. Later in the workshop, we’ll learn how these separate environment keys can be used to apply the multi-environment view of the CloudBees Feature Management dashboard. This will allow a flag to have a separate and unique Production configuration from its Development environment counterpart. However, in this lab we will update a GitHub pull request between the development
and main
branch of your mircroblog-frontend
repository.
microblog-frontend
repository.main
to development
. After changing branches to the development
branch, click on the .env.production
file.development
branch. .env.production
file being edited.YOUR_PRODUCTION_KEY_HERE
on Line 1 by pasting your unique Production Key value that you copied.development
branch radio button. Then click the Commit changes button.microblog-frontend
repository (development
branch). Click the .env.development
file. And then select the pencil icon on the following page to make an edit to the file.YOUR_DEVELOPMENT_KEY_HERE
in the .env.development
file with that value. Make sure you copied and replaced the value for the Development environment and the .env.development
file on the development
branch.development
branch radio button, and then click Commit changes.
The flags.js
file imports the relevant CloudBees Feature Management SDK and defines the feature flags (with the flags’ DEFAULT
values) that an application will use. The file contains a call to the setup
function that establishes a connection to the CloudBees Feature Management dashboard. The CloudBees Feature Management dashboard interface will allow for remote configuration in future labs.
microblog-frontend
repository (ensure you are working on the development
branch).flags.js
file (src\utils\flags.js
) by first clicking the src
folder from root view, followed by the utils
folder, and finally select the subsequent flags.js
file. title
feature flag we are about to add. Click the pencil to edit the file. title
flag and its default value (false
) by adding the following within the const Flag
section after Line 4:export const Flags = {
sidebar: new Rox.Flag(false),
title: new Rox.Flag(false)
}
development
branch radio button, and then click Commit changes.Once you committed the flags.js
file a job will be triggered on a CloudBees CI managed controller that was provisioned for you for this workshop. That job will build and deploy your microblog-frontend
application.
microblog-frontend
repository./src/utils/flags.js
file. flags.js
file, then click on the 3 dots to bring up the menu to access and click the Edit file link. sidebar: new Rox.Flag(false)
, and then click the Commit changes button. title
and sidebar
flags have been added to the default
namespace and communicated from the development
code. This means they are available for remote configuration in the dashboard! There are also some default properties that have been added, but we’ll add more in a future lab. flag.js
file, and an outline of their configurations (though we have none yet) defined across all environments. Congratulations! You have finished the setup of the CloudBees Feature Management Workshop.
For instructor led workshops please return to the workshop slides