diff options
author | Jan-Simon Möller <jsmoeller@linuxfoundation.org> | 2016-08-16 18:26:19 +0200 |
---|---|---|
committer | Jan-Simon Möller <jsmoeller@linuxfoundation.org> | 2016-08-17 13:27:14 +0200 |
commit | 46ae6ad6151e3a05d80a0d7cfd9e44841fb4bcfd (patch) | |
tree | 1b2c52cd19639f490c2b56cde493e0a959885fc0 /jjb | |
parent | 245ec5ec552c8c97e867c03aa9645834886cbf2b (diff) |
Initial version of the ci-management repo
Based on the open-o template. Modified for AGL.
v2 fixed host key and only pushing ci-management jobs.
- fix macro vs. definition in file
Change-Id: I2de02a572a5d8ca1bf6b7a56bfd2e30bfe18fa9a
Signed-off-by: Jan-Simon Möller <jsmoeller@linuxfoundation.org>
Diffstat (limited to 'jjb')
-rw-r--r-- | jjb/ci-management/ci-management.yaml | 78 | ||||
-rw-r--r-- | jjb/ci-management/include-raw-jjb-update.sh | 10 | ||||
-rw-r--r-- | jjb/global-defaults.yaml | 14 | ||||
-rw-r--r-- | jjb/global-macros.yaml | 246 |
4 files changed, 348 insertions, 0 deletions
diff --git a/jjb/ci-management/ci-management.yaml b/jjb/ci-management/ci-management.yaml new file mode 100644 index 00000000..ceb8df83 --- /dev/null +++ b/jjb/ci-management/ci-management.yaml @@ -0,0 +1,78 @@ +--- +- project: + name: ci-management-jobs + jobs: + - 'ci-management-verify-jjb' + - 'ci-management-merge' + + project: 'ci-management' + branch: master + +- job-template: + name: ci-management-verify-jjb + + project-type: freestyle + node: master + concurrent: true + + parameters: + - agl-infra-parameters: + project: '{project}' + branch: 'master' + refspec: 'refs/heads/master' + + scm: + - gerrit-trigger-scm: + refspec: '$GERRIT_REFSPEC' + choosing-strategy: 'gerrit' + + wrappers: + - ssh-agent-credentials: + users: + - '{ssh-credentials}' + + triggers: + - gerrit-trigger-patch-submitted: + name: '{project}' + branch: '{branch}' + + builders: + - shell: | + ls -alh ; jenkins-jobs test --recursive jjb/ + - ci-management-check-unicode + +- job-template: + name: 'ci-management-merge' + + project-type: freestyle + node: master + + build-discarder: + days-to-keep: 30 + num-to-keep: 40 + artifact-days-to-keep: -1 + artifact-num-to-keep: 5 + + parameters: + - agl-infra-parameters: + project: '{project}' + branch: 'master' + refspec: 'refs/heads/master' + + scm: + - gerrit-trigger-scm: + refspec: '' + choosing-strategy: 'default' + + wrappers: + - agl-infra-wrappers: + build-timeout: '{build-timeout}' + + triggers: + - gerrit-trigger-patch-merged: + name: '{project}' + branch: '{branch}' + + builders: + - shell: + !include-raw-escape: include-raw-jjb-update.sh diff --git a/jjb/ci-management/include-raw-jjb-update.sh b/jjb/ci-management/include-raw-jjb-update.sh new file mode 100644 index 00000000..aca40dc6 --- /dev/null +++ b/jjb/ci-management/include-raw-jjb-update.sh @@ -0,0 +1,10 @@ +jenkins-jobs update --delete-old --recursive jjb/ + +# Submit patches for any jobs that can be auto updated +function submitJJB { + git commit -asm "Update automated project templates" + git push origin HEAD:refs/for/master +} + +gitdir=$(git rev-parse --git-dir); scp -p -P 39418 agl-jobbuilder@gerrit.automotievlinux.org.org:hooks/commit-msg ${gitdir}/hooks/ +git diff --exit-code || submitJJB diff --git a/jjb/global-defaults.yaml b/jjb/global-defaults.yaml new file mode 100644 index 00000000..155ae000 --- /dev/null +++ b/jjb/global-defaults.yaml @@ -0,0 +1,14 @@ +--- +# GLOBAL jenkins defaults + +- defaults: + name: global + + build-days-to-keep: 30 + build-num-to-keep: 40 + build-artifact-days-to-keep: -1 + build-artifact-num-to-keep: 5 + # Timeout in minutes + build-timeout: 360 + build-node: ubuntu-16.04-basebuild-2c-1g + ssh-credentials: 'jenkins-gerrit-credentials' diff --git a/jjb/global-macros.yaml b/jjb/global-macros.yaml new file mode 100644 index 00000000..2222b668 --- /dev/null +++ b/jjb/global-macros.yaml @@ -0,0 +1,246 @@ +--- +# Global macros + +# PARAMETERS +- parameter: + name: agl-infra-parameters + parameters: + - string: + name: PROJECT + default: '{project}' + # yamllint disable rule:line-length + description: "JJB configured PROJECT parameter to identify a Gerrit project" + # yamllint enable + - string: + name: GERRIT_BRANCH + default: '{branch}' + description: "JJB configured GERRIT_BRANCH parameter" + - string: + name: GERRIT_PROJECT + default: '{project}' + description: "GERRIT_PROJECT parameter if not given by trigger" + - string: + name: GERRIT_REFSPEC + default: '{refspec}' + description: "GERRIT_REFSPEC parameter if not given by trigger" + +# SCMS +- scm: + name: git-scm + scm: + - git: + credentials-id: 'agl-jenkins-gerrit-user' + url: '$GIT_BASE' + refspec: '' + branches: + - 'origin/${branch}' + skip-tag: true + wipe-workspace: true + +- scm: + name: gerrit-trigger-scm + scm: + - git: + credentials-id: 'agl-jenkins-gerrit-user' + url: '$GIT_BASE' + refspec: '{refspec}' + branches: + - 'origin/$GERRIT_BRANCH' + skip-tag: true + choosing-strategy: '{choosing-strategy}' + +- scm: + name: gerrit-trigger-scm-basedir + scm: + - git: + credentials-id: 'agl-jenkins-gerrit-user' + url: '$GIT_BASE' + refspec: '{refspec}' + branches: + - 'origin/$GERRIT_BRANCH' + skip-tag: true + choosing-strategy: '{choosing-strategy}' + basedir: '{basedir}' + +- scm: + name: git-branch-scm + scm: + - git: + credentials-id: 'agl-jenkins-gerrit-user' + url: '$GIT_BASE' + refspec: '' + branches: + - 'origin/{branch}' + skip-tag: true + wipe-workspace: true + +# TRIGGERS +- trigger: + name: gerrit-trigger-patch-submitted + triggers: + - gerrit: + server-name: 'gerrit-new.automotivelinux.org' + trigger-on: + - patchset-created-event: + exclude-drafts: 'false' + exclude-trivial-rebase: 'false' + exclude-no-code-change: 'false' + - draft-published-event + - comment-added-contains-event: + comment-contains-value: 'recheck' + - comment-added-contains-event: + comment-contains-value: 'reverify' + projects: + - project-compare-type: 'ANT' + project-pattern: '{name}' + branches: + - branch-compare-type: 'ANT' + branch-pattern: '**/{branch}' + +- trigger: + name: gerrit-trigger-patch-merged + triggers: + - gerrit: + server-name: 'gerrit-new.automotivelinux.org' + trigger-on: + - change-merged-event + - comment-added-contains-event: + comment-contains-value: 'remerge' + projects: + - project-compare-type: 'ANT' + project-pattern: '{name}' + branches: + - branch-compare-type: 'ANT' + branch-pattern: '**/{branch}' + +- trigger: + name: gerrit-trigger-silent-patch-submitted + triggers: + - gerrit: + server-name: 'gerrit-new.automotivelinux.org' + trigger-on: + - patchset-created-event: + exclude-drafts: 'false' + exclude-trivial-rebase: 'false' + exclude-no-code-change: 'false' + - draft-published-event + - comment-added-contains-event: + comment-contains-value: 'recheck' + - comment-added-contains-event: + comment-contains-value: 'reverify' + projects: + - project-compare-type: 'ANT' + project-pattern: '{name}' + branches: + - branch-compare-type: 'ANT' + branch-pattern: '**/{branch}' + silent-start: 'true' + +- trigger: + name: gerrit-trigger-silent-full-check + triggers: + - gerrit: + server-name: 'gerrit-new.automotivelinux.org' + trigger-on: + - comment-added-contains-event: + comment-contains-value: 'fullcheck' + projects: + - project-compare-type: 'ANT' + project-pattern: '{name}' + branches: + - branch-compare-type: 'ANT' + branch-pattern: '**/{branch}' + silent-start: 'true' + +- trigger: + name: gerrit-trigger-silent-patch-merged + triggers: + - gerrit: + server-name: 'gerrit-net.automotivelinux.org' + trigger-on: + - change-merged-event + - comment-added-contains-event: + comment-contains-value: 'remerge' + projects: + - project-compare-type: 'ANT' + project-pattern: '{name}' + branches: + - branch-compare-type: 'ANT' + branch-pattern: '**/{branch}' + silent-start: 'true' + +- trigger: + name: gerrit-trigger-tag + triggers: + - gerrit: + server-name: 'gerrit-new.automotivelinux.org' + trigger-on: + - ref-updated-event + projects: + - project-compare-type: 'ANT' + project-pattern: '{name}' + branches: + - branch-compare-type: 'ANT' + branch-pattern: 'refs/tags/**' + +# Publishers +- publisher: + name: archive-artifacts + publishers: + - archive: + artifacts: '{artifacts}' + allow-empty: true + fingerprint: true + latest-only: true + +- publisher: + name: email-notification + publishers: + - email-ext: + recipients: 'nobody@automotivelinux.org' + reply-to: + content-type: default + # yamllint disable rule:line-length + subject: '{email-prefix} $PROJECT_NAME - Build # $BUILD_NUMBER - $BUILD_STATUS!' + # yamllint enable + body: | + $PROJECT_NAME - Build # $BUILD_NUMBER - $BUILD_STATUS: + + Check console output at $BUILD_URL to view the results. + unstable: true + fixed: true + send-to: + - developers + - recipients + +# BUILDERS +- builder: + name: ci-management-check-unicode + builders: + - shell: | + $WORKSPACE/scripts/check-unicode.sh jjb/ + +# WRAPPERS +- wrapper: + name: build-timeout + wrappers: + - timeout: + type: absolute + timeout: 360 + fail: true + +- wrapper: + # This wrapper is required for all jobs as it configures the wrappers + # needed by the automotivelinux.org infra. + name: agl-infra-wrappers + wrappers: + - timeout: + type: absolute + timeout: '{build-timeout}' + timeout-var: 'BUILD_TIMEOUT' + fail: true + - ssh-agent-credentials: + users: + - 'agl-jenkins-ssh' + - jclouds: + single-use: True |