From a1d82bbf246837c4ff83ca95246157aacf465c0a Mon Sep 17 00:00:00 2001 From: Trevor Bramwell Date: Wed, 20 Jul 2016 16:48:59 -0700 Subject: Move Releng Jobs under 'releng' folder This should help clarify what jobs belong to releng, and that the yaml file is unaffiliated with 'releng-defaults' and 'releng-macros'. - Step [1/2] in publishing jobs to the Jenkins sandbox - Explicitly passes the '-r' to jenkins-jobs so that other understand releng recursively tests jobs. This option is implied by the jenkins-job-builder configuration on the server. JIRA: RELENG-91 Change-Id: Ic4bad170b3d311376a2d081089ac538b53595728 Signed-off-by: Trevor Bramwell --- jjb/releng-jobs.yaml | 124 ------------------------------------------ jjb/releng/releng-ci-jobs.yml | 124 ++++++++++++++++++++++++++++++++++++++++++ jjb/releng/verify-releng.sh | 21 +++++++ jjb/verify-releng | 21 ------- 4 files changed, 145 insertions(+), 145 deletions(-) delete mode 100644 jjb/releng-jobs.yaml create mode 100644 jjb/releng/releng-ci-jobs.yml create mode 100755 jjb/releng/verify-releng.sh delete mode 100755 jjb/verify-releng diff --git a/jjb/releng-jobs.yaml b/jjb/releng-jobs.yaml deleted file mode 100644 index d73ef50b7..000000000 --- a/jjb/releng-jobs.yaml +++ /dev/null @@ -1,124 +0,0 @@ -- project: - name: builder-jobs - jobs: - - 'builder-verify-jjb' - - 'builder-merge' - - 'artifacts-api' - - project: 'releng' - -- job-template: - name: builder-verify-jjb - - parameters: - - project-parameter: - project: '{project}' - - gerrit-parameter: - branch: 'master' - scm: - - gerrit-trigger-scm: - credentials-id: '{ssh-credentials}' - refspec: '$GERRIT_REFSPEC' - choosing-strategy: 'gerrit' - - triggers: - - gerrit: - 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: 'releng' - branches: - - branch-compare-type: 'ANT' - branch-pattern: '**/master' - file-paths: - - compare-type: ANT - pattern: jjb/** - - compare-type: ANT - pattern: jjb-templates/** - - compare-type: ANT - pattern: utils/** - - - builders: - - shell: - !include-raw: verify-releng - - publishers: - - archive-artifacts: - artifacts: 'job_output/*' - -- job-template: - name: 'builder-merge' - - # builder-merge job to run JJB update - # - # This job's purpose is to update all the JJB - - parameters: - - project-parameter: - project: '{project}' - - gerrit-parameter: - branch: 'master' - - scm: - - gerrit-trigger-scm: - credentials-id: '{ssh-credentials}' - refspec: '' - choosing-strategy: 'default' - - triggers: - - gerrit: - trigger-on: - - change-merged-event - - comment-added-contains-event: - comment-contains-value: 'remerge' - projects: - - project-compare-type: 'ANT' - project-pattern: 'releng' - branches: - - branch-compare-type: 'ANT' - branch-pattern: '**/master' - file-paths: - - compare-type: ANT - pattern: jjb/** - - compare-type: ANT - pattern: utils/** - - builders: - - shell: | - source /opt/virtualenv/jenkins-job-builder/bin/activate - cd /opt/jenkins-ci/releng - git pull - jenkins-jobs update --delete-old jjb/ - -- job-template: - name: 'artifacts-api' - - # Generate and upload the JSON file to used for artifacts site - - parameters: - - project-parameter: - project: '{project}' - - gerrit-parameter: - branch: 'master' - - scm: - - gerrit-trigger-scm: - credentials-id: '{ssh-credentials}' - refspec: '' - choosing-strategy: 'default' - - triggers: - - timed: '@hourly' - - builders: - - build-and-upload-artifacts-json-api diff --git a/jjb/releng/releng-ci-jobs.yml b/jjb/releng/releng-ci-jobs.yml new file mode 100644 index 000000000..60551f5bb --- /dev/null +++ b/jjb/releng/releng-ci-jobs.yml @@ -0,0 +1,124 @@ +- project: + name: builder-jobs + jobs: + - 'builder-verify-jjb' + - 'builder-merge' + - 'artifacts-api' + + project: 'releng' + +- job-template: + name: builder-verify-jjb + + parameters: + - project-parameter: + project: '{project}' + - gerrit-parameter: + branch: 'master' + scm: + - gerrit-trigger-scm: + credentials-id: '{ssh-credentials}' + refspec: '$GERRIT_REFSPEC' + choosing-strategy: 'gerrit' + + triggers: + - gerrit: + 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: 'releng' + branches: + - branch-compare-type: 'ANT' + branch-pattern: '**/master' + file-paths: + - compare-type: ANT + pattern: jjb/** + - compare-type: ANT + pattern: jjb-templates/** + - compare-type: ANT + pattern: utils/** + + + builders: + - shell: + !include-raw: verify-releng.sh + + publishers: + - archive-artifacts: + artifacts: 'job_output/*' + +- job-template: + name: 'builder-merge' + + # builder-merge job to run JJB update + # + # This job's purpose is to update all the JJB + + parameters: + - project-parameter: + project: '{project}' + - gerrit-parameter: + branch: 'master' + + scm: + - gerrit-trigger-scm: + credentials-id: '{ssh-credentials}' + refspec: '' + choosing-strategy: 'default' + + triggers: + - gerrit: + trigger-on: + - change-merged-event + - comment-added-contains-event: + comment-contains-value: 'remerge' + projects: + - project-compare-type: 'ANT' + project-pattern: 'releng' + branches: + - branch-compare-type: 'ANT' + branch-pattern: '**/master' + file-paths: + - compare-type: ANT + pattern: jjb/** + - compare-type: ANT + pattern: utils/** + + builders: + - shell: | + source /opt/virtualenv/jenkins-job-builder/bin/activate + cd /opt/jenkins-ci/releng + git pull + jenkins-jobs update --delete-old jjb/ + +- job-template: + name: 'artifacts-api' + + # Generate and upload the JSON file to used for artifacts site + + parameters: + - project-parameter: + project: '{project}' + - gerrit-parameter: + branch: 'master' + + scm: + - gerrit-trigger-scm: + credentials-id: '{ssh-credentials}' + refspec: '' + choosing-strategy: 'default' + + triggers: + - timed: '@hourly' + + builders: + - build-and-upload-artifacts-json-api diff --git a/jjb/releng/verify-releng.sh b/jjb/releng/verify-releng.sh new file mode 100755 index 000000000..5c2dbff7a --- /dev/null +++ b/jjb/releng/verify-releng.sh @@ -0,0 +1,21 @@ +#!/bin/bash +# SPDX-license-identifier: Apache-2.0 +############################################################################## +# Copyright (c) 2016 Linux Foundation and others. +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## +#test for non-ascii characters, these can pass the test and end up breaking things in production +for x in $(find . -name *\.yml); do + + if LC_ALL=C grep -q '[^[:print:][:space:]]' "$x"; then + echo "file "$x" contains non-ascii characters" + exit 1 + fi + +done + +source /opt/virtualenv/jenkins-job-builder/bin/activate +jenkins-jobs test -o job_output -r jjb/ diff --git a/jjb/verify-releng b/jjb/verify-releng deleted file mode 100755 index 82d76e366..000000000 --- a/jjb/verify-releng +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash -# SPDX-license-identifier: Apache-2.0 -############################################################################## -# Copyright (c) 2016 Linux Foundation and others. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Apache License, Version 2.0 -# which accompanies this distribution, and is available at -# http://www.apache.org/licenses/LICENSE-2.0 -############################################################################## -#test for non-ascii characters, these can pass the test and end up breaking things in production -for x in $(find . -name *\.yml); do - - if LC_ALL=C grep -q '[^[:print:][:space:]]' "$x"; then - echo "file "$x" contains non-ascii characters" - exit 1 - fi - -done - -source /opt/virtualenv/jenkins-job-builder/bin/activate -jenkins-jobs test -o job_output jjb/ -- cgit 1.2.3-korg