-
Suggestion
-
Resolution: Fixed
-
None
Description
Some CI tools such as TravisCI, GitLab, GitHub, Bitbucket Pipelines, etc use environment variables like CI=true or CI=1 to control the non-interactive execution of their build process. At the moment this cannot be controlled from within Bamboo in the case where Bamboo calls Travis CI or another tool that uses the same variable.
Proposed solution
Add a configuration switch to export the CI=true environment variable for the build agent (remote or elastic).
Workaround
- Option 1: Define the variable CI=true as a global environment variable at the OS level on the machine that runs the Bamboo agent, for example /etc/environment or /etc/profile, or the Bamboo user account's .profile, .bashrc, etc
- Option 2: Remote Agents: Modify the <bamboo-agent-home>/conf/wrapper.conf, add a line such as the one below and restart the Agent:
set.CI=true
- Option 3: Elastic Agents: Add the following command on the Agent's Instance Startup Script:
Linux image
sudo su -c "echo \"export CI=true\" >> /etc/profile.d/bamboo.sh"
Windows imagepowershell.exe -Command "[System.Environment]::SetEnvironmentVariable(\"CI\", 'true', 'Machine')"
- Option 4: Docker Agent: Modify the Docker image's config/wrapper.conf.j2 template and add the following:
set.CI=true
Note: The value for the CI variable was initially accepted as 1. Currently it is accepted as true.