次にリストされたタスクを実行するには、リモート デスクトップ クライアントを使用して管理者アカウントでインスタンスにログインします。

Subscribing to this page is the best idea you're going to have today.

ユーザー アカウントを設定する

Bamboo エージェントが使用するユーザー アカウントを作成します。アカウント名は自由に指定ください。次の例では Bamboo を使用しています。お使いのマシンで実行中のすべてのビルドが、このアカウントを使用します。一般ユーザーでかまいません (つまり、ビルドで必要な場合を除き、パワー ユーザーや管理者である必要はありません)。そのユーザーのパスワードを設定します。Windows イメージの既定のユーザーは、ユーザー名は Bamboo、パスワードは Atlassian1 です。

Important: by default, a newly created user should be denied remote login rights (which is as we want it to be). To be on the safe side, please make sure that you indeed cannot log in using that user's credentials (unless you change them to non-default ones

You'll need to set up autologin for your Bamboo account (don’t worry, this will not let remote users in). To do this, run control userpasswords2 and uncheck “User must enter a user name and password to enter this computer”:


 

ファイアウォールを設定する

ポート 26224 で TCP 接続を受け入れるように Windows ファイアウォールを再設定します。Bamboo にはその他のインバウンド接続は必要ありません。

You don’t need to worry about changing the EC2 security group setting for this port, Bamboo will set it up automatically:

必要なソフトウェアをインストールする

  1. Install a supported Oracle Java version (6 or 7).
  2. Download the latest version of agent installer zip from this this location (at the time this guide was written, the latest version was this). Unpack it to a desired location, we suggest using C:\opt\bamboo-elastic-agent to match stock images distributed with Bamboo.
  3. A batch file should launch with your Windows instance startup. In order to do this, use the Windows Task Scheduler (Start->Administrative Tools->Task Scheduler), and set up a new task with Action “Start a program->PATH TO YOUR BATCH FILE”. Remember to select “Run whether user is logged on or not” in the “General” tab and appropriately define the task Trigger so that the agent starts up only after the network connection is up and running.

The task manager will warn you that the account needs to be able to log in as a batch job. Make sure the “Log on as batch job” policy is set for the user. This policy is accessible by opening the Control Panel -> Administrative Tools -> Local Security Policy. In the Local Security Policy window, click Local Policies -> User Rights Assignment -> Log on as batch job:

テスト

The easiest way to check if everything is set up correctly, is to run the task you've defined using Windows Task Scheduler (Start->Administrative Tools->Task Scheduler). Right click on the task and select "Run". Always test the script using the Task Scheduler - if you run the script manually, you'll use Administrator account, which is not what we want.

Look for the %USERPROFILE%/bamboo-elastic-agent.out file. If it exists and contains an error message stating that agent was not run within an EC2 instance started by Bamboo Server, you’ve successfully completed the customisation.

Run c:\opt\bamboo-elastic-agent\bin\prepareInstanceForSaving.bat .Bundle your instance. Make note of the AMI id of the new image.

Bamboo からのイメージの起動

40 分以内に次の手順を完了しないと Bamboo によってインスタンスがシャット ダウンされるため、時間がなくなった場合は忘れずに作業内容を保存してください (つまり、中間イメージを作成します)。

Bamboo で、先ほど作成したイメージのイメージ構成を定義し、Bamboo から起動します。すべてうまくいけば、エージェントがインスタンスと一緒に起動します。次のステップが実行されます。

すべてうまくいけば、エージェントが Bamboo インスタンス リストに表示されます。これで Bamboo エージェントの起動は完了です。

Because the agent has just synchronised itself with the Bamboo server you have (i.e. downloaded all the jars exactly matching what you have on your server), as an extra step, you may want to save that state to speed up future instance startup and reduce bandwidth usage.

To do it, run c:\opt\bamboo-elastic-agent\bin\prepareInstanceForSaving.bat , save the image, define a new image confguration, kill the instance, and try running it from Bamboo.