X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=blobdiff_plain;f=jjb%2Flf-c-cpp-jobs.yaml;h=d82a9bc1b65be9e3b592021af6aadd852fc65f88;hb=254bbe5cc592a507ff9be80171786526ec9332e7;hp=fa4e35b0a0a5ee12a53383d2b8f8d410621f47d8;hpb=b55451a53da28d40c62de5cae462302a32fe4c31;p=releng%2Fglobal-jjb.git diff --git a/jjb/lf-c-cpp-jobs.yaml b/jjb/lf-c-cpp-jobs.yaml index fa4e35b0..d82a9bc1 100644 --- a/jjb/lf-c-cpp-jobs.yaml +++ b/jjb/lf-c-cpp-jobs.yaml @@ -1,4 +1,42 @@ --- +#################### +# COMMON FUNCTIONS # +#################### + +- lf_cmake_common: &lf_cmake_common + name: lf-cmake-common + + ##################### + # 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}" + branch: "{branch}" + stream: "{stream}" + - lf-cmake-parameters: + build-dir: "{build-dir}" + 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}" + + publishers: + - lf-infra-publish + ############### # CMAKE SONAR # ############### @@ -31,35 +69,6 @@ submodule-timeout: 10 submodule-disable: false - ##################### - # 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}" - branch: "{branch}" - stream: "{stream}" - lftools-version: "{lftools-version}" - - lf-cmake-parameters: - build-dir: "{build-dir}" - 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}" - builders: - lf-infra-pre-build - shell: "{pre-build}" @@ -74,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: @@ -112,6 +119,7 @@ name: "{project-name}-cmake-sonar" id: github-cmake-sonar concurrent: false + <<: *lf_cmake_common <<: *lf_cmake_sonar properties: @@ -159,6 +167,7 @@ github-url: "https://github.com" install-prefix: "$BUILD_DIR/output" make-opts: "" + pre-build: "" stream: master submodule-recursive: true submodule-timeout: 10 @@ -167,28 +176,10 @@ # Sonar properties sonar-additional-args: "" sonar-java-opts: "" - sonar-prescan-script: "" sonar-project-file: "sonar-project.properties" sonar-properties: "" sonar-task: "" - ##################### - # Job Configuration # - ##################### - - project-type: freestyle - node: "{build-node}" - disabled: "{disable-job}" - - properties: - - lf-infra-properties: - build-days-to-keep: "{build-days-to-keep}" - - wrappers: - - lf-infra-wrappers: - build-timeout: "{build-timeout}" - jenkins-ssh-credential: "{jenkins-ssh-credential}" - parameters: - lf-infra-parameters: project: "{project}" @@ -210,7 +201,7 @@ builders: - lf-infra-pre-build - - shell: "{sonar-prescan-script}" + - shell: "{pre-build}" - shell: !include-raw-escape: ../shell/cmake-sonarqube.sh - lf-infra-sonar: sonar-task: "{sonar-task}" @@ -219,15 +210,17 @@ sonar-java-opts: "{sonar-java-opts}" sonar-additional-args: "{sonar-additional-args}" - publishers: - - lf-infra-publish - - 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" @@ -243,9 +236,7 @@ - timed: "{obj:cron}" - gerrit: server-name: "{gerrit-server-name}" - trigger-on: - - comment-added-contains-event: - comment-contains-value: '^Patch Set\s+\d+:\s+run-sonar\s*$' + trigger-on: "{obj:gerrit_sonar_triggers}" projects: - project-compare-type: "ANT" project-pattern: "{project}" @@ -257,6 +248,7 @@ name: "{project-name}-cmake-sonarqube" id: github-cmake-sonarqube concurrent: false + <<: *lf_cmake_common <<: *lf_cmake_sonarqube scm: @@ -310,18 +302,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}" @@ -365,11 +345,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: @@ -382,13 +357,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: @@ -420,6 +393,7 @@ name: "{project-name}-cmake-stage-{stream}" id: github-cmake-stage concurrent: true + <<: *lf_cmake_common <<: *lf_cmake_stage properties: @@ -494,45 +468,15 @@ 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}" - branch: "{branch}" - stream: "{stream}" - - lf-cmake-parameters: - build-dir: "{build-dir}" - 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}" - 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: @@ -562,6 +506,7 @@ name: "{project-name}-cmake-verify-{stream}" id: github-cmake-verify concurrent: true + <<: *lf_cmake_common <<: *lf_cmake_verify properties: