X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=blobdiff_plain;f=jjb%2Flf-macros.yaml;h=bc64719c104bc1ae6696f1c3634de9aa8d137a7c;hb=0786d5870812545b09f27699d7f71d197a257575;hp=4c00ae383635c650b1decd3672135239663518e8;hpb=2d0e35ec2fdbca31583674345cf1b72bf20997d8;p=releng%2Fglobal-jjb.git diff --git a/jjb/lf-macros.yaml b/jjb/lf-macros.yaml index 4c00ae38..bc64719c 100644 --- a/jjb/lf-macros.yaml +++ b/jjb/lf-macros.yaml @@ -1,4 +1,5 @@ --- +# BUILDERS - builder: name: lf-infra-create-netrc # Macro to create a ~/.netrc file from a Maven settings.xml @@ -39,6 +40,41 @@ - description-setter: regexp: '^Build logs: .*' +- builder: + name: lf-infra-sysstat + builders: + - shell: !include-raw: + - ../shell/sysstat.sh + +- builder: + name: lf-jacoco-nojava-workaround + builders: + - shell: 'mkdir -p $WORKSPACE/target/classes $WORKSPACE/jacoco/classes' + +# call maven-target builder with a goal of --version to force Jenkins to +# install the needed maven version +- builder: + name: lf-maven-install + builders: + - maven-target: + maven-version: '{maven-version}' + goals: '--version' + +# Push a global settings and user settings maven files +- builder: + name: lf-provide-maven-settings + builders: + - config-file-provider: + files: + - file-id: '{global-settings-file}' + variable: 'GLOBAL_SETTINGS_FILE' + - file-id: '{settings-file}' + variable: 'SETTINGS_FILE' + + +# PARAMETERS +# Standard parameters used in the LF CI environments. Gerrit variables are not +# used by GitHub projects, but defining them isn't harmful - parameter: name: lf-infra-parameters parameters: @@ -79,6 +115,36 @@ Note that Gerrit will override this parameter automatically if a job is triggered by Gerrit. +# Useful parameters when working with TOX +# https://tox.readthedocs.io/ +- parameter: + name: lf-infra-tox-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. + Example: docs,py2,py3 + +# Set an env var for shell scripts to be able to call the dynamically installed +# maven without having to calculate the path themselves +- parameter: + name: lf-maven-exec + parameters: + - string: + name: MVN + # yamllint disable-line rule:line-length + default: '/w/tools/hudson.tasks.Maven_MavenInstallation/{maven-version}/bin/mvn' + description: 'Maven selector to be used by shell scripts' + + +# PROPERTIES - property: name: lf-infra-properties properties: @@ -89,6 +155,7 @@ # Do not allow artifacts to be stored in Jenkins. artifact-num-to-keep: 0 +# PUBLISHERS - publisher: name: lf-infra-publish # lf-infra macro to finish up a build. @@ -99,6 +166,7 @@ publishers: - postbuildscript: builders: + - lf-infra-sysstat - lf-infra-ship-logs script-only-if-succeeded: false script-only-if-failed: false @@ -110,12 +178,13 @@ - '**/*.jenkins-trigger' fail-build: false +# SCM - scm: name: lf-infra-gerrit-scm scm: - git: credentials-id: '{jenkins-ssh-credential}' - url: '$GIT_URL/$GERRIT_PROJECT' + url: '{git-url}' refspec: '{refspec}' branches: - 'refs/heads/{branch}' @@ -138,6 +207,7 @@ recursive: '{submodule-recursive}' choosing-strategy: '{choosing-strategy}' +# WRAPPERS - wrapper: name: lf-infra-wrappers wrappers: