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_*}
例:
${bamboo_buildNumber}
最終更新日: 2023 年 10 月 9 日
Powered by Confluence and Scroll Viewport.