X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=blobdiff_plain;f=jjb%2Flf-python-jobs.yaml;h=451eb6354424ffe3b3961e9247cc7837d26274f0;hb=5f28702c4a74e49627390ffd108c1beea141a27b;hp=0f38b03570a9cefeec7dc716eccc57336a2fec8f;hpb=02809b26a8e96433dcea87b16918ffc3f68bd743;p=releng%2Fglobal-jjb.git diff --git a/jjb/lf-python-jobs.yaml b/jjb/lf-python-jobs.yaml index 0f38b035..451eb635 100644 --- a/jjb/lf-python-jobs.yaml +++ b/jjb/lf-python-jobs.yaml @@ -7,7 +7,7 @@ name: lf-infra-tox-install builders: - inject: - properties-content: "PYTHON_VERSION={python-version}" + properties-content: "PYTHON={python-version}" - shell: !include-raw-escape: ../shell/tox-install.sh - builder: @@ -206,9 +206,9 @@ - "{branch}" included-regions: "{obj:github_included_regions}" -######################## +######################### # Python Sonar with Tox # -######################## +######################### - lf_tox_sonar: &lf_tox_sonar name: lf-tox_sonar @@ -225,11 +225,12 @@ git-url: "$GIT_URL/$PROJECT" github-url: "https://github.com" java-version: openjdk8 - pre-build-script: "# pre-build script goes here" - python-version: python2 mvn-global-settings: global-settings + mvn-goals: validate mvn-settings: "{mvn-settings}" mvn-version: mvn35 + pre-build-script: "# pre-build script goes here" + python-version: python2 sonar-mvn-goal: "sonar:sonar" stream: master submodule-recursive: true @@ -283,30 +284,15 @@ - lf-provide-maven-settings: global-settings-file: "{mvn-global-settings}" settings-file: "{mvn-settings}" - - lf-infra-tox-sonar: + - lf-infra-maven-sonar: java-version: "{java-version}" + mvn-goals: "{mvn-goals}" mvn-settings: "{mvn-settings}" mvn-version: "{mvn-version}" publishers: - lf-infra-publish -- builder: - name: lf-infra-tox-sonar - # Run a Sonar build with Maven - builders: - - lf-maven-install: - mvn-version: "{mvn-version}" - - lf-update-java-alternatives: - java-version: "{java-version}" - - inject: - # TODO: Switch this to the sonar wrapper when JJB 2.0 is available - properties-content: SONAR_HOST_URL=$SONAR_URL - - shell: !include-raw-escape: - - ../shell/common-variables.sh - - ../shell/maven-sonar.sh - - lf-provide-maven-settings-cleanup - - job-template: name: "{project-name}-tox-sonar" id: gerrit-tox-sonar @@ -391,11 +377,11 @@ included-regions: "{obj:github_included_regions}" ############## -# Tox Verify # +# Tox Common # ############## -- lf_tox_verify: &lf_tox_verify - name: lf-tox-verify +- lf_tox_common: &lf_tox_common + name: lf-tox-common ###################### # Default parameters # @@ -470,7 +456,7 @@ # Python projects typically use tox to run testing. name: "{project-name}-tox-verify-{stream}" id: gerrit-tox-verify - <<: *lf_tox_verify + <<: *lf_tox_common ###################### # Default parameters # @@ -522,7 +508,7 @@ # Python projects typically use tox to run testing. name: "{project-name}-tox-verify-{stream}" id: github-tox-verify - <<: *lf_tox_verify + <<: *lf_tox_common properties: - lf-infra-properties: @@ -551,3 +537,83 @@ white-list-target-branches: - "{branch}" included-regions: "{obj:github_included_regions}" + +- job-template: + # Run tox after merge of gerrit change set + name: "{project-name}-tox-merge-{stream}" + id: gerrit-tox-merge + <<: *lf_tox_common + + ###################### + # Default parameters # + ###################### + + gerrit_merge_triggers: + - change-merged-event + - comment-added-contains-event: + comment-contains-value: '^Patch Set\s+\d+:\s+remerge\s*$' + + ##################### + # Job Configuration # + ##################### + + 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: gerrit + + triggers: + - 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}" + +- job-template: + # Run tox after merge of github pull request + name: "{project-name}-tox-merge-{stream}" + id: github-tox-merge + <<: *lf_tox_common + + properties: + - lf-infra-properties: + build-days-to-keep: "{build-days-to-keep}" + - github: + url: "{github-url}/{github-org}/{project}" + + scm: + - lf-infra-github-scm: + url: "{git-clone-url}{github-org}/{project}" + refspec: "" + branch: "refs/heads/{branch}" + submodule-recursive: "{submodule-recursive}" + submodule-timeout: "{submodule-timeout}" + submodule-disable: "{submodule-disable}" + choosing-strategy: default + jenkins-ssh-credential: "{jenkins-ssh-credential}" + + triggers: + - github-pull-request: + trigger-phrase: "^remerge$" + only-trigger-phrase: true + status-context: "Tox Merge" + permit-all: true + github-hooks: true + org-list: + - "{github-org}" + white-list: "{obj:github_pr_whitelist}" + admin-list: "{obj:github_pr_admin_list}" + white-list-target-branches: + - "{branch}" + included-regions: "{obj:github_included_regions}"