X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=blobdiff_plain;f=jjb%2Flf-macros.yaml;h=f5021d262f64a1fc2020a4f4c4d3fe905d7aa7eb;hb=b9bf2930c67afd6ba69c1be0f672c0a21de34303;hp=ca7d478d80eec6ae15e76290b1756799c4fb20ea;hpb=69cd0eafa798267b44000ac10b529682a1d84e7a;p=releng%2Fglobal-jjb.git diff --git a/jjb/lf-macros.yaml b/jjb/lf-macros.yaml index ca7d478d..f5021d26 100644 --- a/jjb/lf-macros.yaml +++ b/jjb/lf-macros.yaml @@ -31,6 +31,12 @@ - shell: !include-raw-escape: - ../shell/license-check.sh +- builder: + name: lf-infra-capture-instance-metadata + builders: + - shell: !include-raw: + - ../shell/capture-instance-metadata.sh + - builder: name: lf-infra-create-netrc builders: @@ -70,18 +76,32 @@ 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/sudo-logs.sh + - shell: !include-raw: + - ../shell/job-cost.sh - shell: !include-raw: - ../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 @@ -108,9 +128,11 @@ variable: CLOUDENV - inject: properties-content: | + PACKER_BUILDER={packer-builder} PACKER_PLATFORM={platform} PACKER_TEMPLATE={template} PACKER_VERSION={packer-version} + UPDATE_CLOUD_IMAGE={update-cloud-image} - shell: !include-raw-escape: - ../shell/packer-install.sh - ../shell/packer-build.sh @@ -143,6 +165,11 @@ - shell: !include-raw: - ../shell/packer-clear-credentials.sh +- builder: + name: lf-infra-update-packer-images + builders: + - shell: !include-raw: ../shell/update-cloud-images.sh + - builder: name: lf-infra-push-gerrit-patch builders: @@ -203,6 +230,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: @@ -223,13 +274,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: @@ -260,10 +304,20 @@ name: lf-rtd-verify builders: - inject: - properties-content: DOC_DIR={doc-dir} + properties-content: | + DOC_DIR={doc-dir} + PYTHON={python-version} - shell: !include-raw-escape: ../shell/tox-install.sh - shell: !include-raw-escape: ../shell/rtd-verify.sh +- builder: + name: lf-rtdv3-build + builders: + - inject: + properties-content: | + DEFAULT_VERSION={default-version} + - shell: !include-raw-escape: ../shell/rtdv3.sh + - builder: name: check-info-votes builders: @@ -316,10 +370,65 @@ docker rmi -f $(docker images -a -q) exit 0 +- builder: + name: lf-infra-sonar + # Run a Sonar Jenkins Plugin + builders: + - sonar: + sonar-name: Sonar + scanner-name: SonarQubeScanner + task: "{sonar-task}" + project: "{sonar-project-file}" + properties: "{sonar-properties}" + java-opts: "{sonar-java-opts}" + additional-arguments: "{sonar-additional-args}" + +- builder: + name: lf-infra-sonar-with-prescan + # Run a Sonar Jenkins Plugin + builders: + - lf-sonar-prescan # Must be defined by caller + - sonar: + sonar-name: Sonar + scanner-name: SonarQubeScanner + task: "{sonar-task}" + project: "{sonar-project-file}" + properties: "{sonar-properties}" + 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: @@ -475,6 +584,37 @@ Tox environments to run build against. Example: docs,py2,py3 +- parameter: + name: lf-build-with-parameters-maven-release + parameters: + - string: + name: VERSION + default: "" + description: "Version to release, for example: 1.0.0" + - string: + name: GIT_TAG + default: "" + description: "Tag to push to git repo; optional, defaults to VERSION" + - string: + 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: + - None + - container + - maven + description: "Set to maven for build with parameters" + - bool: + name: USE_RELEASE_FILE + default: "{use-release-file}" + description: "Set to False for job built with parameters" + ############## # PROPERTIES # ############## @@ -531,6 +671,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: @@ -568,6 +709,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 # #######