X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=blobdiff_plain;f=jjb%2Flf-maven-jobs.yaml;h=2b5c7944c894af309d06224b69dce2b7b3a536f3;hb=218633e4bdac20bbf838889aa1c6bc514aab3260;hp=a37aaac51e748d6b84f9454cabf784e997e378dc;hpb=564774d9f34ff1caaf15dd13932b214c21ba03f5;p=releng%2Fglobal-jjb.git diff --git a/jjb/lf-maven-jobs.yaml b/jjb/lf-maven-jobs.yaml index a37aaac5..2b5c7944 100644 --- a/jjb/lf-maven-jobs.yaml +++ b/jjb/lf-maven-jobs.yaml @@ -142,6 +142,7 @@ github-url: "https://github.com" java-version: openjdk8 mvn-global-settings: global-settings + mvn-goals: clean install mvn-opts: "" mvn-params: "" mvn-version: mvn35 @@ -194,9 +195,8 @@ - lf-provide-maven-settings: global-settings-file: "{mvn-global-settings}" settings-file: "{mvn-settings}" - - shell: !include-raw-escape: - - ../shell/common-variables.sh - - ../shell/sonatype-clm.sh + - lf-infra-sonatype-clm: + mvn-goals: "{mvn-goals}" - lf-provide-maven-settings-cleanup - shell: 'find . -regex ".*karaf/target" | xargs rm -rf' - nexus-iq-policy-evaluator: @@ -206,6 +206,17 @@ scan-patterns: "{obj:nexus_iq_scan_patterns}" fail-build-network-error: true +- builder: + name: lf-infra-sonatype-clm + # Run a CLM scan build with Maven + builders: + - inject: + properties-content: | + MAVEN_GOALS={mvn-goals} + - shell: !include-raw-escape: + - ../shell/common-variables.sh + - ../shell/sonatype-clm.sh + - job-template: name: "{project-name}-maven-clm-{stream}" id: gerrit-maven-clm @@ -300,6 +311,7 @@ git-url: "$GIT_URL/$PROJECT" github-url: "https://github.com" java-version: openjdk8 + mvn-dir: "." mvn-global-settings: global-settings mvn-opts: "" mvn-params: "" @@ -332,7 +344,9 @@ - lf-infra-create-netrc: server-id: "{mvn-site-id}" - inject: - properties-content: "DEPLOY_PATH={javadoc-path}" + properties-content: | + DEPLOY_PATH={javadoc-path} + MAVEN_DIR={mvn-dir} - shell: !include-raw-escape: - ../shell/common-variables.sh - ../shell/maven-javadoc-generate.sh @@ -429,6 +443,7 @@ git-url: "$GIT_URL/$PROJECT" github-url: "https://github.com" java-version: openjdk8 + mvn-dir: "." mvn-global-settings: global-settings mvn-opts: "" mvn-params: "" @@ -463,6 +478,9 @@ - lf-provide-maven-settings: global-settings-file: "{mvn-global-settings}" settings-file: "{mvn-settings}" + - inject: + properties-content: | + MAVEN_DIR={mvn-dir} - shell: !include-raw-escape: - ../shell/common-variables.sh - ../shell/maven-javadoc-generate.sh @@ -833,7 +851,7 @@ gerrit_release_triggers: - comment-added-contains-event: - comment-contains-value: '^Patch Set\s+\d+:\s+stage-release\s*$' + comment-contains-value: '^Patch Set\s+\d+:\s+stage-(maven-)?release\s*$' gerrit_trigger_file_paths: - compare-type: ANT @@ -964,7 +982,7 @@ triggers: - timed: "{obj:cron}" - github-pull-request: - trigger-phrase: "^build release$" + trigger-phrase: "^stage-(maven-)?release$" only-trigger-phrase: true status-context: "Maven Release" permit-all: true @@ -1015,6 +1033,10 @@ # NO lf-maven-central - lf-provide-maven-settings-cleanup + gerrit_release_docker_triggers: + - comment-added-contains-event: + comment-contains-value: '^Patch Set\s+\d+:\s+stage-(docker-)?release\s*$' + - job-template: name: "{project-name}-maven-docker-stage-{stream}" id: gerrit-maven-docker-stage @@ -1039,7 +1061,7 @@ - timed: "{obj:cron}" - gerrit: server-name: "{gerrit-server-name}" - trigger-on: "{obj:gerrit_release_triggers}" + trigger-on: "{obj:gerrit_release_docker_triggers}" projects: - project-compare-type: ANT project-pattern: "{project}" @@ -1077,7 +1099,7 @@ triggers: - timed: "{obj:cron}" - github-pull-request: - trigger-phrase: "^build release$" + trigger-phrase: "^stage-(docker-)?release$" only-trigger-phrase: true status-context: "Maven Release" permit-all: true @@ -1116,6 +1138,9 @@ sonarcloud-project-key: "" sonarcloud-project-organization: "" sonarcloud-api-token: "" + # SonarCloud scan using jdk8 will become deprecated by Oct, 2020 + # Projects not compatible with jdk11 can set java-version to something else + sonarcloud-java-version: openjdk11 stream: master submodule-recursive: true submodule-timeout: 10 @@ -1174,6 +1199,13 @@ unstable: true notbuilt: true + publishers: + - lf-jacoco-report + - findbugs + - lf-infra-publish + +- mvn_sonar_builders: &mvn_sonar_builders + name: mvn-sonar-builders builders: - lf-infra-pre-build # With SonarCloud @@ -1190,6 +1222,7 @@ sonarcloud-project-key: "{sonarcloud-project-key}" sonarcloud-project-organization: "{sonarcloud-project-organization}" sonarcloud-api-token: "{sonarcloud-api-token}" + sonarcloud-java-version: "{sonarcloud-java-version}" # With SonarQube - conditional-step: condition-kind: not @@ -1204,10 +1237,39 @@ mvn-settings: "{mvn-settings}" mvn-version: "{mvn-version}" - publishers: - - lf-jacoco-report - - findbugs - - lf-infra-publish +- mvn_sonar_builders_prescan_script: &mvn_sonar_builders_prescan_script + name: mvn-sonar-builders-prescan-script + builders: + - shell: "{sonar-prescan-script}" + - lf-infra-pre-build + # With SonarCloud + - conditional-step: + condition-kind: boolean-expression + condition-expression: "{sonarcloud}" + steps: + - shell: echo 'Using SonarCloud' + - lf-infra-maven-sonarcloud: + java-version: "{java-version}" + mvn-goals: "{mvn-goals}" + mvn-settings: "{mvn-settings}" + mvn-version: "{mvn-version}" + sonarcloud-project-key: "{sonarcloud-project-key}" + sonarcloud-project-organization: "{sonarcloud-project-organization}" + sonarcloud-api-token: "{sonarcloud-api-token}" + sonarcloud-java-version: "{sonarcloud-java-version}" + # With SonarQube + - conditional-step: + condition-kind: not + condition-operand: + condition-kind: boolean-expression + condition-expression: "{sonarcloud}" + steps: + - shell: echo 'Using SonarQube' + - lf-infra-maven-sonar: + java-version: "{java-version}" + mvn-goals: "{mvn-goals}" + mvn-settings: "{mvn-settings}" + mvn-version: "{mvn-version}" - builder: name: lf-infra-maven-sonar @@ -1246,6 +1308,7 @@ PROJECT_ORGANIZATION={sonarcloud-project-organization} MAVEN_GOALS={mvn-goals} API_TOKEN={sonarcloud-api-token} + SONARCLOUD_JAVA_VERSION={sonarcloud-java-version} - lf-provide-maven-settings: global-settings-file: global-settings settings-file: "{mvn-settings}" @@ -1260,6 +1323,26 @@ <<: *lf_maven_common # yamllint disable-line rule:key-duplicates <<: *lf_maven_sonar + <<: *mvn_sonar_builders + + 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 + +- job-template: + name: "{project-name}-sonar-prescan-script" + id: gerrit-maven-sonar-prescan-script + <<: *lf_maven_common + # yamllint disable-line rule:key-duplicates + <<: *lf_maven_sonar + <<: *mvn_sonar_builders_prescan_script scm: - lf-infra-gerrit-scm: @@ -1311,6 +1394,46 @@ white-list-target-branches: - "{branch}" +- job-template: + name: "{project-name}-sonar-prescan-script" + id: github-maven-sonar-prescan-script + <<: *lf_maven_common + # yamllint disable-line rule:key-duplicates + <<: *lf_maven_sonar + <<: *mvn_sonar_builders_prescan_script + + 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: "+refs/pull/*:refs/remotes/origin/pr/*" + branch: "$sha1" + submodule-recursive: "{submodule-recursive}" + submodule-timeout: "{submodule-timeout}" + submodule-disable: "{submodule-disable}" + choosing-strategy: default + jenkins-ssh-credential: "{jenkins-ssh-credential}" + + triggers: + - timed: "{obj:cron}" + - github-pull-request: + trigger-phrase: "^run-sonar$" + only-trigger-phrase: true + status-context: "Maven Sonar" + 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}" + ################ # Maven Verify # ################ @@ -1641,3 +1764,4 @@ - branch-compare-type: ANT branch-pattern: "**/{branch}" file-paths: "{obj:gerrit_trigger_file_paths}" + comment-text-parameter-mode: PLAIN