X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=blobdiff_plain;f=jjb%2Flf-python-jobs.yaml;h=451eb6354424ffe3b3961e9247cc7837d26274f0;hb=5f28702c4a74e49627390ffd108c1beea141a27b;hp=0c403262a53d62cccb7f8190824589f4320c974c;hpb=69cd0eafa798267b44000ac10b529682a1d84e7a;p=releng%2Fglobal-jjb.git diff --git a/jjb/lf-python-jobs.yaml b/jjb/lf-python-jobs.yaml index 0c403262..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: @@ -77,6 +77,7 @@ java-version: openjdk8 nexus-iq-cli-version: 1.44.0-01 nexus-iq-namespace: "" # Recommend a trailing dash when set. Example: odl- + pre-build-script: "# pre-build script goes here" stream: master submodule-recursive: true submodule-timeout: 10 @@ -115,6 +116,7 @@ builders: - lf-update-java-alternatives: java-version: "{java-version}" + - shell: "{pre-build-script}" - lf-infra-clm-python: clm-project-name: "{nexus-iq-namespace}{project-name}" @@ -204,9 +206,9 @@ - "{branch}" included-regions: "{obj:github_included_regions}" -######################## +######################### # Python Sonar with Tox # -######################## +######################### - lf_tox_sonar: &lf_tox_sonar name: lf-tox_sonar @@ -223,10 +225,12 @@ git-url: "$GIT_URL/$PROJECT" github-url: "https://github.com" java-version: openjdk8 - 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 @@ -275,34 +279,20 @@ - lf-infra-pre-build - lf-infra-tox-install: python-version: "{python-version}" + - shell: "{pre-build-script}" - shell: !include-raw-escape: ../shell/tox-run.sh - 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 @@ -387,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 # @@ -404,6 +394,7 @@ git-url: "$GIT_URL/$GERRIT_PROJECT" github-url: "https://github.com" parallel: true + pre-build-script: "# pre-build script goes here" python-version: python2 stream: master submodule-recursive: true @@ -455,6 +446,7 @@ - lf-infra-pre-build - lf-infra-tox-install: python-version: "{python-version}" + - shell: "{pre-build-script}" - shell: !include-raw-escape: ../shell/tox-run.sh publishers: @@ -464,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 # @@ -516,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: @@ -545,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}"