Configuring a remote host to receive environment variables from Bamboo

このページの内容

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問

Bamboo SSH tasks can send build-specific variables to a remote host  as environment variables for use during script execution.

If the remote host doesn't allow Bamboo to set environment variables, build-specific variables won't be available for use in shell scripts run by SSH tasks and references to Bamboo build variables (${bamboo_*}) will resolve to empty lines.

To allow Bamboo to set environment variables on the remote host:

  1. Append the following lines to the hosts's  /etc/ssh/sshd_config  file:

    # Allow Bamboo SSH task to pass build variables
    AcceptEnv bamboo_*
  2. 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.