name: gerrit-ci-jobs
jobs:
- "{project-name}-ci-jobs"
- - gerrit-branch-lock
project-name: gerrit-ciman
Gerrit Branch Lock
------------------
-Job submits a patch to lock or unlock a project's branch.
+Job submits a patch to lock or unlock a project's branch. This should only be
+loaded once, as "ci-management-gerrit-branch-lock" (or "ci-management"
+equivalent). That job will process lock/unlock requests for all projects and
+all branches.
:Template Names:
- - {project-name}-gerrit-branch-lock-{stream}
+ - {project-name}-gerrit-branch-lock
- gerrit-branch-lock
:Comment Trigger:
:Optional parameters:
- :branch: Git branch to build against. (default: master)
:git-url: URL to clone project from. (default: $GIT_URL/$GERRIT_PROJECT)
- :stream: Keyword that can be used to represent a release code-name.
- Often the same as the branch. (default: master)
:submodule-timeout: Timeout (in minutes) for checkout operation.
(default: 10)
- :submodule-disable: Disable submodule checkout operation.
- (default: false)
:gerrit_merge_triggers: Override Gerrit Triggers.
.. _lf-global-jjb-jenkins-cfg-merge:
- gerrit-jjb-deploy-job
- gerrit-jjb-merge
- gerrit-jjb-verify
+ - gerrit-branch-lock
- job-group:
name: "{project-name}-github-ci-jobs"
######################
- job-template:
- name: "{project-name}-gerrit-branch-lock-{stream}"
+ name: "{project-name}-gerrit-branch-lock"
id: gerrit-branch-lock
######################
# Default parameters #
######################
- branch: master
+ branch: "**"
disable-job: false
git-url: "$GIT_URL/$GERRIT_PROJECT"
- stream: master
submodule-timeout: 10
- submodule-disable: false
+ submodule-disable: true
gerrit_merge_triggers:
- comment-added-contains-event:
comment-contains-value: (un)?lock branch$
parameters:
- lf-infra-parameters:
project: "{project}"
- stream: "{stream}"
+ stream: ""
branch: "{branch}"
wrappers:
- lf-infra-gerrit-scm:
git-url: "{git-url}"
refspec: ""
- branch: "{branch}"
+ branch: "$GERRIT_BRANCH"
submodule-recursive: false
submodule-timeout: "{submodule-timeout}"
submodule-disable: "{submodule-disable}"
trigger-on: "{obj:gerrit_merge_triggers}"
projects:
- project-compare-type: ANT
- project-pattern: "{project}"
+ project-pattern: "**"
branches:
- branch-compare-type: ANT
branch-pattern: "**/{branch}"
--- /dev/null
+---
+features:
+ - |
+ Add gerrit-branch-lock to gerrit ci-jobs, and make it so that it can be
+ triggered from any change, for any branch.
# Groups must be mapped in the groups file before they can be used
if ! grep 'Registered Users'; then
echo -e "global:Registered-Users\tRegistered Users" >> groups
+ git add groups
fi
mode=$(echo "$GERRIT_EVENT_COMMENT_TEXT" | grep branch | awk '{print $1}')