diff options
author | Benjamin Copeland <ben.copeland@linaro.org> | 2019-04-01 09:43:45 +0100 |
---|---|---|
committer | Benjamin Copeland <ben.copeland@linaro.org> | 2019-04-01 09:43:45 +0100 |
commit | b1c01aa205d6e0e27b2b67e83fe70c1dd5704a3a (patch) | |
tree | 48e2fc3c1d38d3398e0e7b2d94fa2c7443a8cc3f | |
parent | bf47b8eec3a3e017f83614db8d1483d29267d339 (diff) | |
download | tf-ci-scripts-b1c01aa205d6e0e27b2b67e83fe70c1dd5704a3a.tar.gz |
JJB: Setup jenkins job builder
Change-Id: Ic456717fa8a389d9e4b96421f8a39bea7af2b035
-rw-r--r-- | ci-job-configs-sanity-check.yaml | 70 | ||||
-rw-r--r-- | trigger-ci-job-configs.yaml | 88 |
2 files changed, 158 insertions, 0 deletions
diff --git a/ci-job-configs-sanity-check.yaml b/ci-job-configs-sanity-check.yaml new file mode 100644 index 0000000..1f6bb08 --- /dev/null +++ b/ci-job-configs-sanity-check.yaml @@ -0,0 +1,70 @@ +- job: + name: ci-job-configs-sanity-check + project-type: freestyle + defaults: global + properties: + - authorization: + anonymous: + - job-read + - job-extended-read + - build-discarder: + days-to-keep: 30 + num-to-keep: 30 + disabled: false + node: master + display-name: 'CI job configs sanity check' + scm: + - git: + url: https://review.trustedfirmware.org/${GERRIT_PROJECT} + refspec: ${GERRIT_REFSPEC} + branches: + - ${GERRIT_BRANCH} + skip-tag: true + clean: + before: true + choosing-strategy: gerrit + basedir: configs + triggers: + - gerrit: + server-name: 'review.trustedfirmware.org' + trigger-on: + - patchset-created-event + projects: + - project-compare-type: 'PLAIN' + project-pattern: 'ci/job/configs' + branches: + - branch-pattern: 'master' + silent-start: true + wrappers: + - timestamps + builders: + - shell: | + #!/bin/bash -e + echo "#${BUILD_NUMBER}-${GERRIT_PATCHSET_REVISION:0:8}" > ${WORKSPACE}/version.txt + - build-name-setter: + name: 'version.txt' + file: true + - shell: | + #!/bin/bash + + set -e + + echo "" + echo "########################################################################" + echo " Gerrit Environment" + env |grep '^GERRIT' + echo "########################################################################" + + cd configs/ + + # FIXME run-jjb.py was meant to be used for deployment only + # use JJB 'test' command instead of 'update' command + sed -i "s|update|test|" run-jjb.py + + export GIT_PREVIOUS_COMMIT=$(git rev-parse HEAD~1) + export GIT_COMMIT=${GERRIT_PATCHSET_REVISION} + jenkins-jobs --version + python ci/run-jjb.py + publishers: + - email: + recipients: 'fathi.boudra@linaro.org ben.copeland@linaro.org' diff --git a/trigger-ci-job-configs.yaml b/trigger-ci-job-configs.yaml new file mode 100644 index 0000000..9bd8f77 --- /dev/null +++ b/trigger-ci-job-configs.yaml @@ -0,0 +1,88 @@ +- job: + name: trigger-ci-job-configs + project-type: freestyle + defaults: global + properties: + - authorization: + anonymous: + - job-discover + linaro: + - job-read + - job-extended-read + - build-discarder: + days-to-keep: 30 + num-to-keep: 200 + disabled: false + node: master + display-name: 'CI job configs deployment' + scm: + - git: + url: https://review.trustedfirmware.org/${GERRIT_PROJECT} + refspec: ${GERRIT_REFSPEC} + branches: + - ${GERRIT_BRANCH} + skip-tag: true + clean: + before: true + choosing-strategy: gerrit + basedir: configs + triggers: + - gerrit: + server-name: 'review.trustedfirmware.org' + trigger-on: + - change-merged-event + projects: + - project-compare-type: 'PLAIN' + project-pattern: 'ci/job/configs' + branches: + - branch-pattern: 'master' + silent-start: true + wrappers: + - timestamps + - credentials-binding: + - text: + credential-id: JJB_USER + variable: JJB_USER + - credentials-binding: + - text: + credential-id: JJB_PASSWORD + variable: JJB_PASSWORD + - credentials-binding: + - text: + credential-id: LAVA_USER + variable: LAVA_USER + - credentials-binding: + - text: + credential-id: LAVA_TOKEN + variable: LAVA_TOKEN + - credentials-binding: + - text: + credential-id: AUTH_TOKEN + variable: AUTH_TOKEN + builders: + - shell: | + #!/bin/bash -e + echo "#${BUILD_NUMBER}-${GERRIT_PATCHSET_REVISION:0:8}" > ${WORKSPACE}/version.txt + - build-name-setter: + name: 'version.txt' + file: true + - shell: | + #!/bin/bash + + set -e + + echo "" + echo "########################################################################" + echo " Gerrit Environment" + env |grep '^GERRIT' + echo "########################################################################" + + cd configs/ + + export GIT_PREVIOUS_COMMIT=$(git rev-parse HEAD~1) + export GIT_COMMIT=${GERRIT_PATCHSET_REVISION} + jenkins-jobs --version + python ci/run-jjb.py + publishers: + - email: + recipients: 'fathi.boudra@linaro.org ben.copeland@linaro.org' |