X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=blobdiff_plain;f=jjb%2Flf-c-cpp-jobs.yaml;h=115eac719d128266e8d6af01bb3bee25df0035f4;hb=5c0ab82a3e6479cf0ac2a34e97503a0af4c19fde;hp=72cbfd8413bcda8af71f87806fb70a223abdd57a;hpb=227dc247632240097740bf3cfece2829bfd3cf14;p=releng%2Fglobal-jjb.git diff --git a/jjb/lf-c-cpp-jobs.yaml b/jjb/lf-c-cpp-jobs.yaml index 72cbfd84..115eac71 100644 --- a/jjb/lf-c-cpp-jobs.yaml +++ b/jjb/lf-c-cpp-jobs.yaml @@ -1,34 +1,10 @@ --- -############### -# CMAKE Sonar # -############### - -- lf_cmake_sonar: &lf_cmake_sonar - name: lf-cmake-sonar +#################### +# COMMON FUNCTIONS # +#################### - ###################### - # Default parameters # - ###################### - - branch: master - build-days-to-keep: 7 - build-dir: "$WORKSPACE/target" - build-timeout: 15 - cmake-opts: "" - cron: "@daily" - disable-job: false - git-url: "$GIT_URL/$PROJECT" - github-url: "https://github.com" - install-prefix: "$BUILD_DIR/output" - make-opts: "" - pre-build: "" - sonar-scanner-version: 3.3.0.1492 - sonarcloud-api-token: "" - sonarcloud-organization: "" - sonarcloud-project-key: "" - submodule-recursive: true - submodule-timeout: 10 - submodule-disable: false +- lf_cmake_common: &lf_cmake_common + name: lf-cmake-common ##################### # Job Configuration # @@ -47,7 +23,6 @@ project: "{project}" branch: "{branch}" stream: "{stream}" - lftools-version: "{lftools-version}" - lf-cmake-parameters: build-dir: "{build-dir}" cmake-opts: "{cmake-opts}" @@ -59,6 +34,41 @@ build-timeout: "{build-timeout}" jenkins-ssh-credential: "{jenkins-ssh-credential}" + publishers: + - lf-infra-publish + +############### +# CMAKE SONAR # +############### + +- lf_cmake_sonar: &lf_cmake_sonar + name: lf-cmake-sonar + + ###################### + # Default parameters # + ###################### + + branch: master + build-days-to-keep: 7 + build-dir: "$WORKSPACE/target" + build-timeout: 15 + cmake-opts: "" + cron: "@daily" + disable-job: false + git-url: "$GIT_URL/$PROJECT" + github-url: "https://github.com" + install-prefix: "$BUILD_DIR/output" + make-opts: "" + pre-build: "" + sonar-scanner-version: 3.3.0.1492 + sonarcloud-api-token: "" + sonarcloud-organization: "" + sonarcloud-project-key: "" + stream: master + submodule-recursive: true + submodule-timeout: 10 + submodule-disable: false + builders: - lf-infra-pre-build - shell: "{pre-build}" @@ -73,13 +83,11 @@ - shell: !include-raw-escape: ../shell/cmake-sonar.sh - lf-provide-maven-settings-cleanup - publishers: - - lf-infra-publish - - job-template: name: "{project-name}-cmake-sonar" id: gerrit-cmake-sonar concurrent: false + <<: *lf_cmake_common <<: *lf_cmake_sonar scm: @@ -99,7 +107,7 @@ server-name: "{gerrit-server-name}" trigger-on: - comment-added-contains-event: - comment-contains-value: '^Patch Set\s+\d+:\s+stage-release\s*$' + comment-contains-value: '^Patch Set\s+\d+:\s+run-sonar\s*$' projects: - project-compare-type: "ANT" project-pattern: "{project}" @@ -111,6 +119,7 @@ name: "{project-name}-cmake-sonar" id: github-cmake-sonar concurrent: false + <<: *lf_cmake_common <<: *lf_cmake_sonar properties: @@ -133,6 +142,136 @@ triggers: - timed: "{obj:cron}" +################### +# CMAKE SONARQUBE # +################### + +- lf_cmake_sonarqube: &lf_cmake_sonarqube + name: lf-cmake-sonarqube + + ###################### + # Default parameters # + ###################### + + archive-artifacts: > + **/*.log + branch: master # Sonar should always be run on master branch + build-days-to-keep: 7 + build-dir: "$WORKSPACE/build" + build-timeout: 15 + build-wrap-dir: "$WORKSPACE/bw-output" + cmake-opts: "" + cron: "@weekly" + disable-job: false + git-url: "$GIT_URL/$PROJECT" + github-url: "https://github.com" + install-prefix: "$BUILD_DIR/output" + make-opts: "" + pre-build: "" + stream: master + submodule-recursive: true + submodule-timeout: 10 + submodule-disable: false + + # Sonar properties + sonar-additional-args: "" + sonar-java-opts: "" + sonar-project-file: "sonar-project.properties" + sonar-properties: "" + sonar-task: "" + + parameters: + - lf-infra-parameters: + project: "{project}" + branch: "{branch}" + stream: "{stream}" + - lf-cmake-parameters: + build-dir: "{build-dir}" + cmake-opts: "{cmake-opts}" + install-prefix: "{install-prefix}" + make-opts: "{make-opts}" + - string: + name: ARCHIVE_ARTIFACTS + default: "{archive-artifacts}" + description: Artifacts to archive to the logs server. + - string: + name: BUILD_WRAP_DIR + default: "{build-wrap-dir}" + description: SonarQube build wrapper output directory. + + builders: + - lf-infra-pre-build + - shell: "{pre-build}" + - shell: !include-raw-escape: ../shell/cmake-sonarqube.sh + - lf-infra-sonar: + sonar-task: "{sonar-task}" + sonar-project-file: "{sonar-project-file}" + sonar-properties: "{sonar-properties}" + sonar-java-opts: "{sonar-java-opts}" + sonar-additional-args: "{sonar-additional-args}" + +- job-template: + name: "{project-name}-cmake-sonarqube" + id: gerrit-cmake-sonarqube + concurrent: false + <<: *lf_cmake_common + <<: *lf_cmake_sonarqube + + gerrit_sonar_triggers: + - comment-added-contains-event: + comment-contains-value: '^Patch Set\s+\d+:\s+run-sonar\s*$' + + scm: + - lf-infra-gerrit-scm: + branch: "$GERRIT_BRANCH" + jenkins-ssh-credential: "{jenkins-ssh-credential}" + git-url: "{git-url}" + refspec: "$GERRIT_REFSPEC" + 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_sonar_triggers}" + projects: + - project-compare-type: "ANT" + project-pattern: "{project}" + branches: + - branch-compare-type: "ANT" + branch-pattern: "**/{branch}" + +- job-template: + name: "{project-name}-cmake-sonarqube" + id: github-cmake-sonarqube + concurrent: false + <<: *lf_cmake_common + <<: *lf_cmake_sonarqube + + scm: + - lf-infra-github-scm: + branch: "$sha1" + jenkins-ssh-credential: "{jenkins-ssh-credential}" + url: "{git-clone-url}{github-org}/{project}" + refspec: "+refs/pull/*:refs/remotes/origin/pr/*" + submodule-recursive: "{submodule-recursive}" + submodule-timeout: "{submodule-timeout}" + submodule-disable: "{submodule-disable}" + choosing-strategy: default + + triggers: + - github-pull-request: + trigger-phrase: "^run-sonar$" + only-trigger-phrase: false + status-context: "CMake Sonarqube" + permit-all: true + github-hooks: true + white-list-target-branches: + - "{branch}" + ############### # CMAKE STAGE # ############### @@ -153,6 +292,7 @@ disable-job: false git-url: "$GIT_URL/$PROJECT" github-url: "https://github.com" + install: true install-prefix: "$BUILD_DIR/output" make-opts: "" mvn-global-settings: global-settings @@ -163,18 +303,6 @@ submodule-disable: false version: "" - ##################### - # Job Configuration # - ##################### - - project-type: freestyle - node: "{build-node}" - disabled: "{disable-job}" - - properties: - - lf-infra-properties: - build-days-to-keep: "{build-days-to-keep}" - parameters: - lf-infra-parameters: project: "{project}" @@ -185,6 +313,10 @@ cmake-opts: "{cmake-opts}" install-prefix: "{install-prefix}" make-opts: "{make-opts}" + - bool: + name: INSTALL + default: "{install}" + description: "Install build products to /usr/local (true/false)." - string: name: NEXUS_GROUP_ID default: "{nexus-group-id}" @@ -218,11 +350,6 @@ | awk '{{print $NF}}' | awk -F')' '{{print $1}}')" echo "${{MAJOR_VERSION}}.${{MINOR_VERSION}}.${{PATCH_VERSION}}" > /tmp/artifact_version - wrappers: - - lf-infra-wrappers: - build-timeout: "{build-timeout}" - jenkins-ssh-credential: "{jenkins-ssh-credential}" - builders: - lf-infra-pre-build - lf-provide-maven-settings: @@ -235,13 +362,11 @@ - shell: !include-raw-escape: ../shell/cmake-stage.sh - lf-provide-maven-settings-cleanup - publishers: - - lf-infra-publish - - job-template: name: "{project-name}-cmake-stage-{stream}" id: gerrit-cmake-stage concurrent: true + <<: *lf_cmake_common <<: *lf_cmake_stage scm: @@ -273,6 +398,7 @@ name: "{project-name}-cmake-stage-{stream}" id: github-cmake-stage concurrent: true + <<: *lf_cmake_common <<: *lf_cmake_stage properties: @@ -303,6 +429,148 @@ white-list-target-branches: - "{branch}" +################## +# CMAKE+PC STAGE # +################## + +- lf_cmake_pc_stage: &lf_cmake_pc_stage + name: lf-cmake-packagecloud-stage + + ###################### + # Default parameters # + ###################### + + branch: master + build-days-to-keep: 7 + build-dir: "$WORKSPACE/build" + build-timeout: 15 + cmake-opts: "" + disable-job: false + git-url: "$GIT_URL/$PROJECT" + github-url: "https://github.com" + install: false + install-prefix: "$BUILD_DIR/output" + make-opts: "" + pre-build: "" + stream: master + submodule-recursive: true + submodule-timeout: 10 + submodule-disable: false + + gerrit_trigger_file_paths: + - compare-type: REG_EXP + pattern: ".*" + + # github_included_regions MUST match gerrit_trigger_file_paths + github_included_regions: + - ".*" + + parameters: + - lf-infra-parameters: + project: "{project}" + branch: "{branch}" + stream: "{stream}" + - lf-cmake-parameters: + build-dir: "{build-dir}" + cmake-opts: "{cmake-opts}" + install-prefix: "{install-prefix}" + make-opts: "{make-opts}" + - bool: + name: INSTALL + default: "{install}" + description: "Install build products to /usr/local (true/false)." + + builders: + - config-file-provider: + files: + - file-id: ".packagecloud" + target: "$HOME/.packagecloud" + - shell: "{pre-build}" + - shell: !include-raw-escape: ../shell/cmake-build.sh + - lf-packagecloud-push: + build-dir: "{build-dir}" + packagecloud-account: "{packagecloud-account}" + packagecloud-repo: "{packagecloud-repo}" + debian-distribution-versions: "{debian-distribution-versions}" + rpm-distribution-versions: "{rpm-distribution-versions}" + +- job-template: + # build with cmake and publish to PackageCloud on command + name: "{project-name}-cmake-packagecloud-stage-{stream}" + id: gerrit-cmake-packagecloud-stage + <<: *lf_cmake_common + <<: *lf_cmake_pc_stage + + ###################### + # Default parameters # + ###################### + + gerrit_stage_triggers: + - comment-added-contains-event: + comment-contains-value: '^Patch Set\s+\d+:\s+stage-release\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}" + # stage jobs always build from tip + choosing-strategy: default + + triggers: + - gerrit: + server-name: "{gerrit-server-name}" + trigger-on: "{obj:gerrit_stage_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: + name: "{project-name}-cmake-packagecloud-stage-{stream}" + id: github-cmake-packagecloud-stage + concurrent: true + <<: *lf_cmake_common + <<: *lf_cmake_pc_stage + + 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: + - github-pull-request: + trigger-phrase: "^(stage-release)$" + only-trigger-phrase: true + status-context: "CMake PackageCloud Stage" + permit-all: true + github-hooks: true + white-list-target-branches: + - "{branch}" + ################ # CMAKE VERIFY # ################ @@ -322,6 +590,7 @@ disable-job: false git-url: "$GIT_URL/$PROJECT" github-url: "https://github.com" + install: true install-prefix: "$BUILD_DIR/output" make-opts: "" pre-build: "" @@ -347,18 +616,6 @@ github_included_regions: - ".*" - ##################### - # Job Configuration # - ##################### - - project-type: freestyle - node: "{build-node}" - disabled: "{disable-job}" - - properties: - - lf-infra-properties: - build-days-to-keep: "{build-days-to-keep}" - parameters: - lf-infra-parameters: project: "{project}" @@ -369,23 +626,20 @@ cmake-opts: "{cmake-opts}" install-prefix: "{install-prefix}" make-opts: "{make-opts}" - - wrappers: - - lf-infra-wrappers: - build-timeout: "{build-timeout}" - jenkins-ssh-credential: "{jenkins-ssh-credential}" + - bool: + name: INSTALL + default: "{install}" + description: "Install build products to /usr/local (true/false)." builders: - shell: "{pre-build}" - shell: !include-raw-escape: ../shell/cmake-build.sh - publishers: - - lf-infra-publish - - job-template: name: "{project-name}-cmake-verify-{stream}" id: gerrit-cmake-verify concurrent: true + <<: *lf_cmake_common <<: *lf_cmake_verify scm: @@ -415,6 +669,7 @@ name: "{project-name}-cmake-verify-{stream}" id: github-cmake-verify concurrent: true + <<: *lf_cmake_common <<: *lf_cmake_verify properties: