From: Jessica Wagantall Date: Tue, 12 Nov 2019 22:07:53 +0000 (+0000) Subject: Merge "Refactor ORAN build-by-shell job templates" X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=commitdiff_plain;h=794199e22a30783d64442071b2718afaf6b64d74;hp=223c60c5688bd67a9629f7a548a9c9c8ef6841b3;p=ci-management.git Merge "Refactor ORAN build-by-shell job templates" --- diff --git a/jjb/oran-jjb/oran-shell-jobs.yaml b/jjb/oran-jjb/oran-shell-jobs.yaml index 5a5b861f..3b688536 100644 --- a/jjb/oran-jjb/oran-shell-jobs.yaml +++ b/jjb/oran-jjb/oran-shell-jobs.yaml @@ -12,47 +12,31 @@ # See the License for the specific language governing permissions and # limitations under the License. --- -# -# Template for verifying gerrit changeset by shell script. -# Runs on changeset branch to verify new commits; can also run on master. -# -# Required parameters: -# build-node: label (flavor) of jenkins build minion -# project: git repository -# project-name: Jenkins job name prefix -# script: shell script to execute -# Optional parameters: -# branch: git branch, defaults to master -# stream: friendly stream name (often same as branch), defaults to master -- job-template: - name: '{project-name}-verify-shell-{stream}' - id: oran-verify-shell +- oran_shell_common: &oran_shell_common + name: oran-shell-common ###################### # Default parameters # ###################### + archive-artifacts: > + **/*.log branch: master build-days-to-keep: 7 build-timeout: 15 + cron: '' + concurrent: false disable-job: false - gerrit_trigger_file_paths: - - compare-type: REG_EXP - pattern: '.*' gerrit-skip-vote: false - gerrit_verify_triggers: - - patchset-created-event: - exclude-drafts: true - exclude-trivial-rebase: false - exclude-no-code-change: false - - draft-published-event - - comment-added-contains-event: - comment-contains-value: '^Patch Set\s+\d+:\s+(recheck|reverify)\s*$' - git-url: '$GIT_URL/$PROJECT' + git-url: '$GIT_URL/$GERRIT_PROJECT' stream: master + submodule-disable: false submodule-recursive: true submodule-timeout: 10 - submodule-disable: false + + gerrit_trigger_file_paths: + - compare-type: REG_EXP + pattern: '.*' ##################### # Job Configuration # @@ -71,12 +55,47 @@ project: '{project}' branch: '{branch}' stream: '{stream}' + - string: + name: ARCHIVE_ARTIFACTS + default: '{archive-artifacts}' + description: Artifacts to archive to the logs server. wrappers: - lf-infra-wrappers: build-timeout: '{build-timeout}' jenkins-ssh-credential: '{jenkins-ssh-credential}' + builders: + - shell: '{script}' + + publishers: + - lf-infra-publish + +# Verify gerrit changeset by shell script. +# Runs on changeset branch to verify new commits; can be run on any branch. +# +# Required parameters: +# build-node: label (flavor) of jenkins build minion +# project: git repository +# project-name: Jenkins job name prefix +# script: shell script to execute +# Optional parameters: +# branch: git branch pattern, defaults to master +# stream: friendly stream name (often same as branch), defaults to master +- job-template: + name: '{project-name}-shell-verify-{stream}' + id: oran-shell-verify + <<: *oran_shell_common + + gerrit_verify_triggers: + - patchset-created-event: + exclude-drafts: true + exclude-trivial-rebase: false + exclude-no-code-change: false + - draft-published-event + - comment-added-contains-event: + comment-contains-value: '^Patch Set\s+\d+:\s+(recheck|reverify)\s*$' + scm: - lf-infra-gerrit-scm: jenkins-ssh-credential: '{jenkins-ssh-credential}' @@ -89,6 +108,7 @@ choosing-strategy: gerrit triggers: + - timed: '{obj:cron}' - gerrit: server-name: '{gerrit-server-name}' trigger-on: '{obj:gerrit_verify_triggers}' @@ -105,8 +125,47 @@ unstable: '{gerrit-skip-vote}' notbuilt: '{gerrit-skip-vote}' - builders: - - shell: '{script}' +# Build from gerrit by shell script. +# Triggered automatically by merge; can be run on any branch. +# +# Required parameters: +# build-node: label (flavor) of jenkins build minion +# project: git repository +# project-name: Jenkins job name prefix +# script: shell script to execute +# Optional parameters: +# branch: git branch pattern, defaults to master +# stream: friendly stream name (often same as branch), defaults to master +- job-template: + name: '{project-name}-shell-merge-{stream}' + id: oran-shell-merge + <<: *oran_shell_common - publishers: - - lf-infra-publish + gerrit_merge_triggers: + - change-merged-event + - comment-added-contains-event: + comment-contains-value: '^Patch Set\s+\d+:\s+remerge\s*$' + + scm: + - lf-infra-gerrit-scm: + jenkins-ssh-credential: '{jenkins-ssh-credential}' + git-url: '{git-url}' + refspec: '$GERRIT_REFSPEC' + branch: '$GERRIT_BRANCH' + submodule-recursive: '{submodule-recursive}' + submodule-timeout: '{submodule-timeout}' + submodule-disable: '{submodule-disable}' + choosing-strategy: default + + triggers: + - timed: '{obj:cron}' + - gerrit: + server-name: '{gerrit-server-name}' + trigger-on: '{obj:gerrit_merge_triggers}' + projects: + - project-compare-type: ANT + project-pattern: '{project}' + branches: + - branch-compare-type: ANT + branch-pattern: '**/{branch}' + file-paths: '{obj:gerrit_trigger_file_paths}' diff --git a/jjb/pti-rtp/pti-rtp.yaml b/jjb/pti-rtp/pti-rtp.yaml index 240d58cc..14f231e6 100644 --- a/jjb/pti-rtp/pti-rtp.yaml +++ b/jjb/pti-rtp/pti-rtp.yaml @@ -23,4 +23,4 @@ build-timeout: 60 script: !include-raw-escape: verify-pti-rtp-centos.sh jobs: - - oran-verify-shell + - oran-shell-verify