X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=blobdiff_plain;f=jjb%2Flf-macros.yaml;h=4032c5f44790aa6cbcf3cd91fcd6b066019755cb;hb=5d336574e77fb349ace15356ef8ffb816d463544;hp=94113458729d5c4087e47c39caf833d424932ab2;hpb=026509df164f628deb0f4660a172cca364ff58ae;p=releng%2Fglobal-jjb.git diff --git a/jjb/lf-macros.yaml b/jjb/lf-macros.yaml index 94113458..4032c5f4 100644 --- a/jjb/lf-macros.yaml +++ b/jjb/lf-macros.yaml @@ -11,10 +11,18 @@ builders: - shell: !include-raw: ../shell/comment-to-gerrit.sh +- builder: + name: lf-ansible-config-file-provider + builders: + - config-file-provider: + files: + - file-id: "ansible-cfg" + target: "$HOME/.ansible/ansible.cfg" + - builder: name: lf-fetch-dependent-patches builders: - - shell: !include-raw: ../shell/gerrit-fetch-dependencies.sh + - shell: !include-raw-escape: ../shell/gerrit-fetch-dependencies.sh - inject: properties-file: $WORKSPACE/.dependency.properties @@ -31,6 +39,12 @@ - shell: !include-raw-escape: - ../shell/license-check.sh +- builder: + name: lf-infra-capture-instance-metadata + builders: + - shell: !include-raw-escape: + - ../shell/capture-instance-metadata.sh + - builder: name: lf-infra-create-netrc builders: @@ -70,30 +84,43 @@ files: - file-id: "jenkins-log-archives-settings" variable: "SETTINGS_FILE" + - conditional-step: + condition-kind: regex-match + regex: "^.*logs-s3.*" + label: $S3_BUCKET + on-evaluation-failure: dont-run + steps: + - config-file-provider: + files: + - file-id: "jenkins-s3-log-ship" + target: $HOME/.aws/credentials - lf-infra-create-netrc: server-id: logs - shell: !include-raw: # Ensure python-tools are installed in case job template does not # call the lf-infra-pre-build macro. - ../shell/python-tools-install.sh - - shell: !include-raw: + - shell: !include-raw-escape: - ../shell/sudo-logs.sh - - shell: !include-raw: + - shell: !include-raw-escape: + - ../shell/job-cost.sh + - shell: !include-raw-escape: - ../shell/logs-deploy.sh - shell: !include-raw: - ../shell/logs-clear-credentials.sh - description-setter: - regexp: "^Build logs: .*" + regexp: "(^(Nexus|S3) build logs: .*)" - builder: name: lf-infra-package-listing builders: - - shell: !include-raw: + - shell: !include-raw-escape: - ../shell/package-listing.sh - builder: name: lf-infra-packer-build builders: + - lf-ansible-config-file-provider - conditional-step: condition-kind: boolean-expression condition-expression: "{openstack}" @@ -107,9 +134,11 @@ - config-file-provider: files: - file-id: "{packer-cloud-settings}" + target: "$HOME/.config/jenkins_jobs/cloud-env.pkrvars.hcl" variable: CLOUDENV - inject: properties-content: | + PACKER_BUILDER={packer-builder} PACKER_PLATFORM={platform} PACKER_TEMPLATE={template} PACKER_VERSION={packer-version} @@ -136,6 +165,7 @@ - config-file-provider: files: - file-id: "{packer-cloud-settings}" + target: "$HOME/.config/jenkins_jobs/cloud-env.pkrvars.hcl" variable: CLOUDENV - inject: properties-content: | @@ -149,7 +179,7 @@ - builder: name: lf-infra-update-packer-images builders: - - shell: !include-raw: ../shell/update-cloud-images.sh + - shell: !include-raw-escape: ../shell/update-cloud-images.sh - builder: name: lf-infra-push-gerrit-patch @@ -167,7 +197,7 @@ - builder: name: lf-infra-sysstat builders: - - shell: !include-raw: + - shell: !include-raw-escape: - ../shell/sysstat.sh - builder: @@ -211,6 +241,30 @@ - shell: !include-raw-escape: ../shell/maven-central.sh - lf-provide-maven-settings-cleanup +- builder: + name: lf-packagecloud-file-provider + builders: + - config-file-provider: + files: + - file-id: ".packagecloud" + target: "$HOME/.packagecloud" + - config-file-provider: + files: + - file-id: "packagecloud_api" + target: "$HOME/packagecloud_api" + +- builder: + name: lf-packagecloud-push + builders: + - inject: + properties-content: | + BUILD_DIR={build-dir} + PACKAGECLOUD_ACCOUNT={packagecloud-account} + PACKAGECLOUD_REPO={packagecloud-repo} + DEBIAN_DISTRIBUTION_VERSIONS={debian-distribution-versions} + RPM_DISTRIBUTION_VERSIONS={rpm-distribution-versions} + - shell: !include-raw-escape: ../shell/packagecloud-push.sh + - builder: name: lf-maven-install builders: @@ -231,13 +285,6 @@ - file-id: "{settings-file}" variable: "SETTINGS_FILE" -- builder: - name: lf-pip-install - builders: - - inject: - properties-content: PIP_PACKAGES={pip-packages} - - shell: !include-raw-escape: ../shell/pip-install.sh - - builder: name: lf-provide-maven-settings-cleanup builders: @@ -280,7 +327,7 @@ - inject: properties-content: | DEFAULT_VERSION={default-version} - - shell: !include-raw: ../shell/rtdv3.sh + - shell: !include-raw-escape: ../shell/rtdv3.sh - builder: name: check-info-votes @@ -296,7 +343,7 @@ files: - file-id: lftoolsini target: "$HOME/.config/lftools/lftools.ini" - - shell: !include-raw: ../shell/release-job.sh + - shell: !include-raw-escape: ../shell/release-job.sh - builder: name: lf-sigul-sign-dir @@ -346,6 +393,7 @@ properties: "{sonar-properties}" java-opts: "{sonar-java-opts}" additional-arguments: "{sonar-additional-args}" + jdk: "{sonar-jdk}" - builder: name: lf-infra-sonar-with-prescan @@ -361,10 +409,38 @@ java-opts: "{sonar-java-opts}" additional-arguments: "{sonar-additional-args}" +- builder: + name: lf-infra-pipeline-verify + builders: + - shell: !include-raw-escape: ../shell/pipeline-linter.sh + ############## # PARAMETERS # ############## +- parameter: + name: lf-autotools-parameters + # Parameters for configure-make builds. + parameters: + - string: + name: CONFIGURE_OPTS + default: "{configure-opts}" + description: | + Options to pass to configure. + Example: --build=i686-pc-linux-gnu + - string: + name: INSTALL_PREFIX + default: "{install-prefix}" + description: | + Install prefix for configure. + Usually a workspace subdirectory. + - string: + name: MAKE_OPTS + default: "{make-opts}" + description: | + Options to pass to make. + Example: -j8 all + - parameter: name: lf-clm-parameters parameters: @@ -505,6 +581,38 @@ default: "{node-version}" description: Version of NodeJS to install. +- parameter: + name: lf-infra-sonar-cli-parameters + parameters: + - string: + name: TOX_DIR + default: "{tox-dir}" + description: | + Path to directory containing tox.ini file. + - string: + name: TOX_ENVS + default: "{tox-envs}" + description: | + Tox environments to run build against. + - string: + name: SONAR_SCANNER_VERSION + default: "{sonar-scanner-version}" + description: | + Version of sonar scanner to use. + Example: 4.7.0.2747 + - string: + name: SONAR_SCANNER_HOME + default: "{sonar-scanner-home}" + description: | + Sonar scanner home directory. + Example: $WORKSPACE/.sonar/sonar-scanner-$SONAR_SCANNER_VERSION-linux + - string: + name: SONAR_SCANNER_OPTS + default: "{sonar-scanner-opts}" + description: | + Sonar scanner Java options. + Example: -server + - parameter: name: lf-infra-tox-parameters parameters: @@ -518,7 +626,7 @@ default: "{tox-envs}" description: | Tox environments to run build against. - Example: docs,py2,py3 + Example: docs,py3 - parameter: name: lf-build-with-parameters-maven-release @@ -535,6 +643,10 @@ name: LOG_DIR default: "" description: "Log dir, for example: project-maven-stage-master/17/" + - string: + name: OVERRIDE_SEMVER_REGEX + default: "" + description: "Override Semantic Version (SemVer) Regular Expression. Ex: '.*'" - choice: name: DISTRIBUTION_TYPE choices: @@ -573,7 +685,7 @@ class-pattern: "**/classes" source-pattern: "**/src/main/java" # yamllint disable-line rule:line-length - exclusion-pattern: "**/gen/**,**/generated-sources/**,**/yang-gen**,**/pax/**" + exclusion-pattern: "{exclude-pattern}" status-update: true targets: - branch: @@ -603,6 +715,7 @@ build-steps: - lf-infra-sysstat - lf-infra-package-listing + - lf-infra-capture-instance-metadata - lf-infra-ship-logs mark-unstable-if-failed: true - workspace-cleanup: @@ -640,6 +753,27 @@ - "**/*.jenkins-trigger" fail-build: false +- publisher: + name: global-jjb-email-notification + publishers: + - email-ext: + recipients: "{email-recipients}" + reply-to: "" + content-type: default + subject: "{email-prefix} $PROJECT_NAME - Build # $BUILD_NUMBER - $BUILD_STATUS!" + body: | + $PROJECT_NAME - Build # $BUILD_NUMBER - $BUILD_STATUS: + + Please refer to the logs server URL for console logs when possible + and use the Jenkins Build URL as a last resort. + + Jenkins Build URL: + $BUILD_URL + unstable: true + fixed: true + send-to: + - recipients + ####### # SCM # #######