Bamboo での SSH タスクの使用

このページの内容

お困りですか?

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

コミュニティに質問

You can use the Bamboo SSH task to execute a SSH command on a remote computer as part of a Bamboo job.

You can use the SSH task to do such things as:

  • Calling database migration scripts 
  • Starting and stopping services
  • Anything you can run on the command line on a remote machine

See  Configuring a deployment task for an overview of Bamboo deployment tasks.

To configure an SSH task:

  1. ジョブのタスク設定タブに移動します(新しいプランを作成するとデフォルト ジョブとなります)。
  2. Select the name of an existing SSH task, or select Add task > SSH Task to create a new task.
  3. Complete SSH task configuration settings:

    設定説明
    タスクの説明Optional description for the configured task.
    このタスクを無効化Prevent the task from running.
    Add condition to taskRun the task only when a certain condition is met.
    • Condition type (for SSH tasks, Variable is the only available option)
    • Variable name (the name of the Bamboo variable to base the condition on)
    • Condition (the conditional keyword):
      • 存在する
      • not exists
      • equals (exact value)
      • not equals (exact value)
      • matches (regular expression to match variable value)
    ホストComma-separated fully qualified domain names or IP addresses of the remote hosts.
    Authentication type
    Choose whether Bamboo should authenticate with the host using a Username and password or SSH private key, and then either provide custom credentials or select shared credentials.
    SSH command

    The shell command to execute on the remote host. You can only enter a single command here.

    You can configure a remote host to accept build-specific variables  sent from Bamboo as environment variables for use in shell scripts run by the SSH task.

  4. If you want Bamboo to verify the remote host fingerprint on connection, under Advanced options, select Verify remote host fingerprint on connect, and then paste the host fingerprint.

    tip/resting Created with Sketch.

    You can determine the fingerprint for a host by running the following command from a Unix terminal, where <HOSTNAME> is the fully-qualified domain name or IP address of the remote host:

    ssh-keygen -l -F <HOSTNAME>

    例:

    ssh-keygen -l -F myhost.acme.com
  5. Select  Save .

最終更新日: 2023 年 10 月 10 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.