Configuring a remote host to receive environment variables from Bamboo
To allow Bamboo to set environment variables on the remote host:
Append the following lines to the hosts's
/etc/ssh/sshd_config
file:
# Allow Bamboo SSH task to pass build variables AcceptEnv bamboo_*
- Restart the SSH daemon on the remote host:
On Debian-based Linux distributions, run:
sudo systemctl restart ssh
On Red Hat-based Linux distributions, run:
sudo systemctl restart sshd
You can now reference build-specific variables in your shell scripts using the following syntax:
${bamboo_*}
For example:
${bamboo_buildNumber}
Last modified on Oct 9, 2023
Powered by Confluence and Scroll Viewport.