You can use the Bamboo SSH task to execute a SSH command on a remote computer as part of a Bamboo job.
See Configuring a deployment task for an overview of Bamboo deployment tasks.
To configure an SSH task:
- ジョブのタスク設定タブに移動します(新しいプランを作成するとデフォルト ジョブとなります)。
- Click the name of an existing SSH task, or click Add Task and then SSH Task to create a new task.
Complete the following settings:
タスクの説明 タスクの目的を識別するのに役立ちます。 このタスクを無効化 オンまたはオフにすることで、選択的にこのタスクを実行します。 ホスト The hostname or IP address of the remote server on which the SSH Command will be executed. 接続時にリモート ホスト フィンガープリントを確認 Enter the host fingerprint to be verified. See below for more details. ポート SSH 接続に使用されるリモート ホストのポート番号です。デフォルト値は 22 です。 ユーザ名 リモート ホストへの接続に使用するユーザー名です。 認証タイプ パスワード – ユーザー名に関連付けられたパスワードです。 鍵(パスフレーズなし) – リモート ホストでの認証に使用する SSH 秘密鍵を参照します。 鍵(パスフレーズあり) – リモート ホストでの認証に使用する SSH 秘密鍵を参照し、パスフレーズを提供します。 SSH Command The shell command to execute on the remote host. You can only enter a single command here. - Click Save.
ホスト フィンガープリント
以下のコマンドを実行して、ホストのフィンガープリントを判断することができます。
ssh-keygen -l -F <HOSTNAME>
以下のスクリーンショットに示すように、フィンガープリントはレスポンスの一部です。
11 Comments
-
Anonymous
Would it be a nice feature to be able to set a base directory here from which the command will execute?
-
Anonymous
If you have a multi-line command, are the lines run in sequence?
-
Anonymous
Is there a plan to support multi-line command's?
-
When executing commands through the SSH-task, the output from commands are only updated after each command line is executed. Is there any plans to change this behaviour so that the command ouput is shown in Bamboo's deployment log more regularly, i.e updated at a given interval?
-
I need to run a command with sudo but I'm getting "sudo: sorry, you must have a tty to run sudo".
To avoid this error and be able to run a sudo command I need to specify -t option to the ssh command. There is any way to do this ?
-
Hi Alvaro,
I'm not sure what could be the problem here. Could you contact our support team? They would be better equipped to help you.
Thanks
James
-
-
Anonymous
Hi.
How i can used variables in "SSH command" field?
Thx
-
Hi, what exactly are you trying to achieve? Can you provide a few more details?
Cheers,
Nathan
-
Same request here. I'd like to be able to put into the SSH command box something like:
touch "${bamboo.build.number}.txt"
Without it, the benefits of using bamboo deployments are very limited as we need to create a lot of environment-specific tasks.
-
-


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