Allows the release job to be triggered via Gerrit / GitHub PR comment.
This allows contributors to initiate a release build without needing
permissions via Jenkins directly.
Issue: RELENG-426
Change-Id: I2c75f607cc57471afb49fa0347bb130af214ea4b
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
<hudson.plugins.git.extensions.impl.WipeWorkspace/>
</extensions>
</scm>
+ <triggers class="vector">
+ <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTrigger>
+ <spec/>
+ <gerritProjects>
+ <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.GerritProject>
+ <compareType>ANT</compareType>
+ <pattern>releng/ciman</pattern>
+ <branches>
+ <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.Branch>
+ <compareType>ANT</compareType>
+ <pattern>**/master</pattern>
+ </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.Branch>
+ </branches>
+ <disableStrictForbiddenFileVerification>false</disableStrictForbiddenFileVerification>
+ </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.GerritProject>
+ </gerritProjects>
+ <skipVote>
+ <onSuccessful>false</onSuccessful>
+ <onFailed>false</onFailed>
+ <onUnstable>false</onUnstable>
+ <onNotBuilt>false</onNotBuilt>
+ </skipVote>
+ <silentMode>false</silentMode>
+ <silentStartMode>false</silentStartMode>
+ <escapeQuotes>true</escapeQuotes>
+ <noNameAndEmailParameters>false</noNameAndEmailParameters>
+ <readableMessage>false</readableMessage>
+ <dependencyJobsNames/>
+ <notificationLevel/>
+ <dynamicTriggerConfiguration>False</dynamicTriggerConfiguration>
+ <triggerConfigURL/>
+ <allowTriggeringUnreviewedPatches>false</allowTriggeringUnreviewedPatches>
+ <triggerOnEvents>
+ <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginCommentAddedContainsEvent>
+ <commentAddedCommentContains>build release$</commentAddedCommentContains>
+ </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginCommentAddedContainsEvent>
+ </triggerOnEvents>
+ <buildStartMessage/>
+ <buildFailureMessage/>
+ <buildSuccessfulMessage/>
+ <buildUnstableMessage/>
+ <buildNotBuiltMessage/>
+ <buildUnsuccessfulFilepath/>
+ <customUrl/>
+ <serverName>test-server</serverName>
+ </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTrigger>
+ </triggers>
<builders>
<hudson.tasks.Shell>
<command>mkdir -p $WORKSPACE/target/classes $WORKSPACE/jacoco/classes</command>
<hudson.plugins.git.extensions.impl.WipeWorkspace/>
</extensions>
</scm>
+ <triggers class="vector">
+ <org.jenkinsci.plugins.ghprb.GhprbTrigger>
+ <spec/>
+ <adminlist/>
+ <allowMembersOfWhitelistedOrgsAsAdmin>false</allowMembersOfWhitelistedOrgsAsAdmin>
+ <whitelist/>
+ <orgslist/>
+ <cron/>
+ <triggerPhrase>^build release$</triggerPhrase>
+ <onlyTriggerPhrase>true</onlyTriggerPhrase>
+ <useGitHubHooks>true</useGitHubHooks>
+ <permitAll>true</permitAll>
+ <autoCloseFailedPullRequests>false</autoCloseFailedPullRequests>
+ <extensions>
+ <org.jenkinsci.plugins.ghprb.extensions.status.GhprbSimpleStatus>
+ <commitStatusContext>Maven Release</commitStatusContext>
+ </org.jenkinsci.plugins.ghprb.extensions.status.GhprbSimpleStatus>
+ </extensions>
+ </org.jenkinsci.plugins.ghprb.GhprbTrigger>
+ </triggers>
<builders>
<hudson.tasks.Shell>
<command>mkdir -p $WORKSPACE/target/classes $WORKSPACE/jacoco/classes</command>
# staging-profile-id: Profile ID of the project's Nexus staging profile.
#
# Optional parameters:
- # mvn-global-settings: The name of the Maven global settings to use for
- # Maven configuration. (default: global-settings)
+ # :gerrit_verify_triggers: Override Gerrit Triggers.
+ # :mvn-global-settings: The name of the Maven global settings to use for
+ # Maven configuration. (default: global-settings)
######################
# Default parameters #
stream: master
submodule-recursive: true
+ gerrit_release_triggers:
+ - comment-added-contains-event:
+ comment-contains-value: build release$
+
#####################
# Job Configuration #
#####################
submodule-recursive: '{submodule-recursive}'
choosing-strategy: default
+ triggers:
+ - gerrit:
+ server-name: '{gerrit-server-name}'
+ trigger-on: '{obj:gerrit_release_triggers}'
+ projects:
+ - project-compare-type: ANT
+ project-pattern: '{project}'
+ branches:
+ - branch-compare-type: ANT
+ branch-pattern: '**/{branch}'
+
- job-template:
name: '{project-name}-maven-release-{stream}'
id: github-maven-release
choosing-strategy: default
jenkins-ssh-credential: '{jenkins-ssh-credential}'
+ triggers:
+ - lf-infra-github-pr-trigger:
+ trigger-phrase: '^build release$'
+ only-trigger-phrase: true
+ status-context: 'Maven Release'
+ permit-all: true
+ github-hooks: true
+ github-org: ''
+ github_pr_whitelist:
+ - ''
+ github_pr_admin_list:
+ - ''
+
###############
# Maven Sonar #
###############