[Bamboo Knowledge Base]
このページでは、スクリプト実行可能ファイルを使用する Bamboo タスクの設定方法を説明します。Linux では Bash を、Windows ではバッチ ファイルをそれぞれ使用できます。
スクリプト タスクを設定するには、次の手順を実行します。
Complete the following settings:
| スクリプトの設定 | |
|---|---|
| タスクの説明 | A description of the task, which is displayed in Bamboo. |
| スクリプトの場所 | スクリプト ファイルの場所を選択します。
|
| 引数 | Specify an argument to pass to the script. Arguments that contain spaces must be quoted. You can include variables (see Bamboo variables). |
必要に応じて、環境変数と作業ディレクトリの設定を指定します。
| 環境変数 | (Optional) Additional system environment variables that you want to pass to your build. Note that existing environment variables are automatically available to the executable. You can also include Bamboo global or build-specific variables (see Bamboo variables). |
| Working Sub Directory | (オプション) Bamboo が実行ファイルを実行する、ジョブのルート ディレクトリに相対的な代替サブディレクトリ。ルート ディレクトリには、ジョブの構成済みソース リポジトリから確認されたものがすべて含まれます。このフィールドを空白のまま残した場合、Bamboo はルート ディレクトリでビルド ファイルを検索します。このオプションは、サブディレクトリ内にビルド スクリプトがあり、実行可能ファイルをそのサブディレクトリ内から実行する必要がある場合に便利です。 |
| Powershell スクリプトとして実行 | (オプション、Windows のみ).bat ファイルを解釈する cmd.exe ではなく Powershell でスクリプトを実行するには、「Powershell スクリプトとして実行」チェックボックスをチェックします。インライン エディタは Powershell 構文をサポートします。 |
An example that calls a Python script (on a Linux machine):
4 Comments
drcheeves
Oct 16, 2014inline scripts don't work with escaped xml characters
JIRA incident logged here:
BAM-13207 - Getting issue details... STATUS
Matt Jernigan
Nov 06, 2014Okay, I REALLY don't understand why this task is built this way. If I have both Windows and Linux build agents, then the only way to get jobs with a Script task to choose the right agent is to add a custom capability to each agent indicating what kind of script it can run (bash or batch, Windows or Linux, whatever) and then to also add a requirement to each job indicating one or the other. This looks like unnecessary complexity for something that could have been easily automated by adding OS and/or script type capabilities to the default agent capabilities (how hard could that be?) and then providing two or three different script tasks to choose from (bash, batch and/or Powershell) instead of just this singular identity-confused one.
paulwatson
Nov 06, 2014Hi Matt - yep, agree with you on this. I've raised https://jira.atlassian.com/browse/BAM-15189, and quoted your comment above. Please comment further on that issue if you want.
Gerard Iglesias
Jan 29, 2015Hello,
How do we configure Bamboo to use bash instead of sh, there are some limitation that we don't understand, like source or . is not available to the scripting capability.
Thanx in advance