How to disable multiple plans or plan branches in batch

お困りですか?

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

コミュニティに質問

目的

Disable multiple plans or plan branches in batch.

ソリューション

Use the database to Build a sequence of REST calls to do the job:

This solution was designed considering a Postgres database and Unix like OS. It might need some small adjustments to run on a different DB or OS.

If your intention is to just create a staging server where you want the avoid running scheduled triggers, branch detection, and build status, you may follow this KB article to achieve the same.

Disabling the plans and plan branches


  1.  Run the following query on you Bamboo database:

    tip/resting Created with Sketch.

    Make sure you update <BAMBOO_ADMIN_USER>, <BAMBOO_PASSWORD> and <BAMBOO_URL> first.

    SELECT
        concat('curl -k -u <BAMBOO_ADMIN_USER>:<BAMBOO_PASSWORD> -H "Content-type: application/json" -X DELETE <BAMBOO_URL>/rest/api/latest/plan/',concat(FULL_KEY,'/enable'))
    FROM
        BUILD
  2. Create a file called disable_plans.sh with the results of the above query

  3.  Run the bash script file in debug mode:

    bash -x disable_plans.sh


Enabling again the plans and plan branches

  1.  Run the following query on you Bamboo database:

    tip/resting Created with Sketch.

    Make sure you update  <BAMBOO_ADMIN_USER>, <BAMBOO_PASSWORD> and <BAMBOO_URL> first.



    SELECT
        concat('curl -k -u <BAMBOO_ADMIN_USER>:<BAMBOO_PASSWORD> -H "Content-type: application/json" -X POST <BAMBOO_URL>/rest/api/latest/plan/',concat(FULL_KEY,'/enable'))
    FROM
        BUILD
  2. Create a file called enable_plans.sh with the results of the above query

  3.  Run the bash script file in debug mode:

     bash -x enable_plans.sh


最終更新日: 2022 年 10 月 20 日

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

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