blob: 6d91e79cad7be53883e97bb3a18db27816350913 [file] [log] [blame]
- job:
name: gerrit-ci-scripts
description: Gerrit Jenkins Job Builder Scripts
node: server
parameters:
- string:
name: JJB_USER
description: 'Jenkins user authorised to configure jobs'
- password:
name: JJB_PASSWORD
description: 'Jenkins API user token'
scm:
- git:
url: https://gerrit.googlesource.com/a/gerrit-ci-scripts
credentials-id: gerrit.googlesource.com
branches:
- '*/master'
skip-tag: true
triggers:
- pollscm:
cron: 'H/15 * * * *'
builders:
- shell: jenkins-jobs --allow-empty-variables update --delete-old jenkins/.
- job:
name: gerrit-ci-scripts-manual
description: Manually rebuild gerrit-ci-scripts from a specific Change ID and revision
node: server
parameters:
- string:
name: JJB_USER
description: 'Jenkins user authorised to configure jobs'
- password:
name: JJB_PASSWORD
description: 'Jenkins API user token'
- string:
name: CHANGE_NUMBER
description: 'Legacy Change ID of patch to build'
- string:
name: CHANGE_REVISION
default: '1'
description: 'Revision number of patch to build'
- string:
name: CHANGE_COMMIT
description: 'Optional SHA-1 hash of patch to build (takes precedence over Change ID)'
- string:
name: JOBS
description: >
One or several whitespace-separated jobs to update.
(All will be built if left blank.)
properties:
- inject:
properties-file: env.properties
script-content: |
if [ "$CHANGE_COMMIT" ]; then
echo "CHANGE_COMMIT=$CHANGE_COMMIT" > env.properties
else
CHANGE_NUMBER_SUFFIX=$(echo $CHANGE_NUMBER | grep -o '..$')
CHANGE_COMMIT=refs/remotes/origin/$CHANGE_NUMBER_SUFFIX/$CHANGE_NUMBER/$CHANGE_REVISION
echo "CHANGE_COMMIT=$CHANGE_COMMIT" > env.properties
fi
override-build-parameters: true
scm:
- git:
url: https://gerrit.googlesource.com/a/gerrit-ci-scripts
credentials-id: gerrit.googlesource.com
refspec: +refs/changes/*:refs/remotes/origin/*
branches:
- '${CHANGE_COMMIT}'
skip-tag: true
builders:
- shell: |
if test -n "${JOBS}"; then
jenkins-jobs --allow-empty-variables update jenkins ${JOBS}
else
jenkins-jobs --allow-empty-variables update --delete-old jenkins
fi
- job:
name: gerrit-ci-scripts-pipeline
description: Multi-branch pipeline to validate Gerrit's Jenkins Job Builder Scripts
project-type: multibranch
node: server
scm:
- gerrit:
url: https://gerrit-review.googlesource.com/a/gerrit-ci-scripts
credentials-id: gerrit.googlesource.com
refspecs:
- '+refs/heads/*:refs/remotes/@{remote}/*'
- '+refs/changes/*:refs/remotes/@{remote}/*'
property-strategies:
all-branches:
- suppress-scm-triggering: false
- pipeline-branch-durability-override: max-survivability
periodic-folder-trigger: 10m