How to change the build working directory on Bamboo Stock Image elastic agents

お困りですか?

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

コミュニティに質問

問題

Storage limits on some elastic agent instances might require that the build directory of the elastic agent be relocated. 

回避策

You can solve this problem by adding a startup script to your image in Bamboo that will mount an external storage location to a local folder and update the agent configuration. 

  1. In Bamboo server, go to Admin >> Elastic Instances >> Image Configurations
  2. Select the Stock image you want to customize and click Edit
  3. Go to Instance startup script field and add the following script:

    1. Linux Stock image 

      mkdir /b
      chown bamboo:bamboo -R /b
      
      mkdir -p /mnt/bamboo-ebs/bamboo-agent/
      cp /opt/bamboo-elastic-agent/ebs-resources/bamboo-agent.cfg.xml /mnt/bamboo-ebs/bamboo-agent/
      chown bamboo:bamboo -R /mnt/bamboo-ebs
      
      sed -i 's:<buildWorkingDirectory>.*</buildWorkingDirectory>:<buildWorkingDirectory>/b</buildWorkingDirectory>:g' /mnt/bamboo-ebs/bamboo-agent/bamboo-agent.cfg.xml
      su - bamboo -c "/opt/bamboo-elastic-agent/ebs-resources/customiseInstance.sh"
    2. Windows Stock image 

      mkdir C:\b
      icacls "C:\b" /grant Bamboo:(OI)(CI)F /T
      
      sed -i "s/<buildWorkingDirectory>.*</<buildWorkingDirectory>c:\\\b</" C:\Users\Bamboo\bamboo-agent-home\bamboo-agent.cfg.template.xml
  4. Start your elastic instance

最終更新日: 2019 年 10 月 30 日

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

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