Uploaded image for project: 'Bamboo Data Center'
  1. Bamboo Data Center
  2. BAM-20994

Add the ability to set CI=true to the build agent environment

XMLWordPrintable

    • Our product teams collect and evaluate feedback from a number of different sources. To learn more about how we use customer feedback in the planning process, check out our new feature policy.

      Description

      Some CI tools such as TravisCI, GitLab, GitHubBitbucket 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 image
        powershell.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.

              73868399605e Eduardo Alvarenga
              abacs Andrei
              Votes:
              2 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: