This bash script is designed to interactively update an environment variable across multiple projects on CircleCI via API. This script is a convenient way to update an environment variable across multiple projects on CircleCI without having to manually update each one.
-
Open a terminal.
-
Navigate to the directory where the
update-variable.sh
script is located. -
Make the script executable with the following command:
chmod +x update-variable.sh
-
Run the script:
./update-variable.sh
-
The script will prompt you to enter your VCS provider (either "gh" for GitHub or "bb" for Bitbucket), your organization name, your CircleCI token, the name of the environment variable to update, its new value, and the names of the projects (separated by spaces) where the variable should be updated.
-
After you've entered all the required information, the script will automatically send requests to the CircleCI API to update the specified environment variable in each of the specified projects.