Oracle - Repository Polling - Periodically (v5.8+)

お困りですか?

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

コミュニティに質問

プラットフォームについて: Server および Data Center のみ。この記事は、Server および Data Center プラットフォームのアトラシアン製品にのみ適用されます。

Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Fisheye および Crucible は除く

 

 

製品バージョンデータベースDocumentation reference
Bamboo
 V5.8.X V5.9.X V5.10.X V5.11.X V5.12.X V5.13.X
Oracleリポジトリをポーリングして変更を確認する

Lets find out how to get Bamboo's repository polling values from Oracle database along with updating those values.

Get repository polling 

/**
 * Bamboo version: 5.8+
 * Database: Oracle
 * Triggers: 'Repository polling' > 'Polling strategy' > 'Periodically'
 */
select B.FULL_KEY PLAN_KEY,
       B.TITLE TITLE,
       VL.PLUGIN_KEY REPOSITORY_TYPE,
       XMLTYPE(BD.XML_DEFINITION_DATA).EXTRACT('//triggerDefinition/pluginKey[text()="com.atlassian.bamboo.triggers.atlassian-bamboo-triggers:poll"]/../config/item/key[text()="repository.change.poll.type"]/../value[text()="PERIOD"]/../../item/key[text()="repository.change.poll.pollingPeriod"]/../value/text()').getStringVal() FREQUENCY,
       BD.BUILD_DEFINITION_ID BUILD_DEFINITION_ID
  from VCS_LOCATION VL
  join PLAN_VCS_LOCATION PVL on PVL.VCS_LOCATION_ID = VL.VCS_LOCATION_ID
  join BUILD B on PVL.PLAN_ID = B.BUILD_ID
  join BUILD_DEFINITION BD on B.BUILD_ID = BD.BUILD_ID
 where B.SUSPENDED_FROM_BUILDING = 0
 order by FREQUENCY desc, PLAN_KEY, TITLE;

What expect from query above:

PLAN_KEY

タイトル

REPOSITORY_TYPE

FREQUENCY

BUILD_DEFINITION_ID

REP-SVN

Subversion

com.atlassian.bamboo.plugin.system.repository:svn

190

2654213

REP-GIT

Git

com.atlassian.bamboo.plugins.atlassian-bamboo-plugin-git:git

180

2654209

Get repository polling lower than 190 seconds 

/**
 * Bamboo version: 5.8+
 * Database: Oracle
 * Triggers: 'Repository polling' > 'Polling strategy' > 'Periodically'
 */
select B.FULL_KEY PLAN_KEY,
       B.TITLE TITLE,
       VL.PLUGIN_KEY REPOSITORY_TYPE,
       XMLTYPE(BD.XML_DEFINITION_DATA).EXTRACT('//triggerDefinition/pluginKey[text()="com.atlassian.bamboo.triggers.atlassian-bamboo-triggers:poll"]/../config/item/key[text()="repository.change.poll.type"]/../value[text()="PERIOD"]/../../item/key[text()="repository.change.poll.pollingPeriod"]/../value/text()').getStringVal() FREQUENCY,
       BD.BUILD_DEFINITION_ID BUILD_DEFINITION_ID
  from VCS_LOCATION VL
  join PLAN_VCS_LOCATION PVL on PVL.VCS_LOCATION_ID = VL.VCS_LOCATION_ID
  join BUILD B on PVL.PLAN_ID = B.BUILD_ID
  join BUILD_DEFINITION BD on B.BUILD_ID = BD.BUILD_ID
 where B.SUSPENDED_FROM_BUILDING = 0
   and XMLTYPE(BD.XML_DEFINITION_DATA).EXTRACT('//triggerDefinition/pluginKey[text()="com.atlassian.bamboo.triggers.atlassian-bamboo-triggers:poll"]/../config/item/key[text()="repository.change.poll.type"]/../value[text()="PERIOD"]/../../item/key[text()="repository.change.poll.pollingPeriod"]/../value/text()').getStringVal() < 190
 order by FREQUENCY desc, PLAN_KEY, TITLE;

What expect from query above:

PLAN_KEY

タイトル

REPOSITORY_TYPE

FREQUENCY

BUILD_DEFINITION_ID

REP-GIT

Git

com.atlassian.bamboo.plugins.atlassian-bamboo-plugin-git:git

180

2654209

Get repository polling when using Git as Repository Host 

/**
 * Bamboo version: 5.8+
 * Database: Oracle
 * Triggers: 'Repository polling' > 'Polling strategy' > 'Periodically'
 * Condition: 'Repository host' as Git
 */
select B.FULL_KEY PLAN_KEY,
       B.TITLE TITLE,
       VL.PLUGIN_KEY REPOSITORY_TYPE,
       XMLTYPE(BD.XML_DEFINITION_DATA).EXTRACT('//triggerDefinition/pluginKey[text()="com.atlassian.bamboo.triggers.atlassian-bamboo-triggers:poll"]/../config/item/key[text()="repository.change.poll.type"]/../value[text()="PERIOD"]/../../item/key[text()="repository.change.poll.pollingPeriod"]/../value/text()').getStringVal() FREQUENCY,
       BD.BUILD_DEFINITION_ID BUILD_DEFINITION_ID
  from VCS_LOCATION VL
  join PLAN_VCS_LOCATION PVL on PVL.VCS_LOCATION_ID = VL.VCS_LOCATION_ID
  join BUILD B on PVL.PLAN_ID = B.BUILD_ID
  join BUILD_DEFINITION BD on B.BUILD_ID = BD.BUILD_ID
 where B.SUSPENDED_FROM_BUILDING = 0
   and VL.PLUGIN_KEY = 'com.atlassian.bamboo.plugins.atlassian-bamboo-plugin-git:git'
 order by FREQUENCY desc, PLAN_KEY, TITLE;

What expect from query above:

PLAN_KEY

タイトル

REPOSITORY_TYPE

FREQUENCY

BUILD_DEFINITION_ID

REP-GIT

Git

com.atlassian.bamboo.plugins.atlassian-bamboo-plugin-git:git

180

2654209

 

Get repository polling when using Subversion as Repository Host 

/**
 * Bamboo version: 5.8+
 * Database: Oracle
 * Triggers: 'Repository polling' > 'Polling strategy' > 'Periodically'
 * Condition: 'Repository host' as Subversion
 */
select B.FULL_KEY PLAN_KEY,
       B.TITLE TITLE,
       VL.PLUGIN_KEY REPOSITORY_TYPE,
       XMLTYPE(BD.XML_DEFINITION_DATA).EXTRACT('//triggerDefinition/pluginKey[text()="com.atlassian.bamboo.triggers.atlassian-bamboo-triggers:poll"]/../config/item/key[text()="repository.change.poll.type"]/../value[text()="PERIOD"]/../../item/key[text()="repository.change.poll.pollingPeriod"]/../value/text()').getStringVal() FREQUENCY,
       BD.BUILD_DEFINITION_ID BUILD_DEFINITION_ID
  from VCS_LOCATION VL
  join PLAN_VCS_LOCATION PVL on PVL.VCS_LOCATION_ID = VL.VCS_LOCATION_ID
  join BUILD B on PVL.PLAN_ID = B.BUILD_ID
  join BUILD_DEFINITION BD on B.BUILD_ID = BD.BUILD_ID
 where B.SUSPENDED_FROM_BUILDING = 0
   and VL.PLUGIN_KEY = 'com.atlassian.bamboo.plugin.system.repository:svn'
 order by FREQUENCY desc, PLAN_KEY, TITLE;

What expect from query above:

PLAN_KEY

タイトル

REPOSITORY_TYPE

FREQUENCY

BUILD_DEFINITION_ID

REP-SVN

Subversion

com.atlassian.bamboo.plugin.system.repository:svn

190

2654213

Update Repository polling to 600 seconds 

In order to run the updates, you will be required to:

  1. stop Bamboo (bring the instance down)
  2. run the UPDATE statement against Bamboo's database:

    Update repository polling to 600 seconds
    /**
     * Bamboo version: 5.8+
     * Database: Oracle
     * Triggers: 'Repository polling' > 'Polling strategy' > 'Periodically'
     * Condition: update Repository polling to 600 seconds in a given Plan
     */
    update BUILD_DEFINITION BD
       set BD.XML_DEFINITION_DATA = UPDATEXML(XMLTYPE(BD.XML_DEFINITION_DATA),'//triggerDefinition/pluginKey[text()="com.atlassian.bamboo.triggers.atlassian-bamboo-triggers:poll"]/../config/item/key[text()="repository.change.poll.type"]/../value[text()="PERIOD"]/../../item/key[text()="repository.change.poll.pollingPeriod"]/../value/text()',400).getClobVal()
     where BD.BUILD_DEFINITION_ID = 458753;
  3. start Bamboo

Update Repository polling to 600 seconds across all plans 

In order to run the updates, you will be required to:

  1. stop Bamboo (bring the instance down)
  2. run the UPDATE statement against Bamboo's database:

    Update repository polling to 600 seconds
    /**
     * Bamboo version: 5.8+
     * Database: Oracle
     * Triggers: 'Repository polling' > 'Polling strategy' > 'Periodically'
     * Condition: update Repository polling to 600 seconds across all Plans
     */
    update BUILD_DEFINITION BD
       set BD.XML_DEFINITION_DATA = UPDATEXML(XMLTYPE(BD.XML_DEFINITION_DATA),'//triggerDefinition/pluginKey[text()="com.atlassian.bamboo.triggers.atlassian-bamboo-triggers:poll"]/../config/item/key[text()="repository.change.poll.type"]/../value[text()="PERIOD"]/../../item/key[text()="repository.change.poll.pollingPeriod"]/../value/text()',600).getClobVal()
     where BUILD_DEFINITION_ID in (select BUILD_DEFINITION_ID
      from BUILD_DEFINITION BD
     where XMLTYPE(BD.XML_DEFINITION_DATA).EXTRACT('//triggerDefinition/pluginKey[text()="com.atlassian.bamboo.triggers.atlassian-bamboo-triggers:poll"]/../config/item/key[text()="repository.change.poll.type"]/../value[text()="PERIOD"]/../../item/key[text()="repository.change.poll.pollingPeriod"]/../value/text()').getStringVal()
        is not null);
  3. start Bamboo

 

最終更新日 2018 年 11 月 2 日

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

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