From: Andrew Grimberg Date: Mon, 23 Apr 2018 22:40:58 +0000 (+0000) Subject: Merge "Add generic push changes to gerrit builder" X-Git-Tag: v0.19.0~11 X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=commitdiff_plain;h=0b1d0ba4945b93dc5d86fffef20f4be44fc5a2f9;hp=cfc34325599e8540be6de457b5f07ac9e08196b4;p=releng%2Fglobal-jjb.git Merge "Add generic push changes to gerrit builder" --- diff --git a/.jjb-test/lf-python-jobs.yaml b/.jjb-test/lf-python-jobs.yaml index 49214fb2..feb154f3 100644 --- a/.jjb-test/lf-python-jobs.yaml +++ b/.jjb-test/lf-python-jobs.yaml @@ -3,6 +3,7 @@ name: gerrit-python-jobs jobs: - "{project-name}-python-jobs" + - gerrit-tox-sonar project-name: gerrit-python @@ -10,5 +11,6 @@ name: github-python-jobs jobs: - "{project-name}-github-python-jobs" + - github-tox-sonar project-name: github-python diff --git a/.jjb-test/lf-rtd-jobs.yaml b/.jjb-test/lf-rtd-jobs.yaml index 753803b5..1f1f7001 100644 --- a/.jjb-test/lf-rtd-jobs.yaml +++ b/.jjb-test/lf-rtd-jobs.yaml @@ -5,8 +5,9 @@ - gerrit-rtd-merge - gerrit-rtd-verify - rtd-project: gerrit-rtd project-name: gerrit-rtd + rtd-build-url: fake-rtd-build-url + rtd-token: fake-rtd-token - project: name: github-rtd-jobs @@ -14,5 +15,6 @@ - github-rtd-merge - github-rtd-verify - rtd-project: github-rtd project-name: github-rtd + rtd-build-url: fake-rtd-build-url + rtd-token: fake-rtd-token diff --git a/docs/conf.py b/docs/conf.py index 3c5afa40..1be20512 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -67,7 +67,7 @@ author = 'Linux Foundation Releng' # built documents. # # The short X.Y version. -version = '0.18.0-dev' +version = '0.19.0-dev' # The full version, including alpha/beta/rc tags. release = version diff --git a/docs/configuration.rst b/docs/configuration.rst index e1177e1a..e212d9ce 100644 --- a/docs/configuration.rst +++ b/docs/configuration.rst @@ -19,7 +19,7 @@ Documentation for npmrc is available via the `npm project `_. :Required: This file MUST exist. An empty file is acceptable if a -proxy is not available for the project. + proxy is not available for the project. :type: Custom file Create a "Custom file" with contents: @@ -36,7 +36,7 @@ in $HOME/.config/pip/pip.conf. Documentation for pip.conf is available via the `pip project `_. :Required: This file MUST exist. An empty file is acceptable if a -proxy is not available for the project. + proxy is not available for the project. :type: Custom file Create a "Custom file" with contents: diff --git a/docs/index.rst b/docs/index.rst index 78931120..0eec76f5 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -35,12 +35,15 @@ Global JJB Templates Job template code is in the `jjb/` directory but documentation is in the `docs/jjb/` directory of this project. -- :doc:`jjb/lf-ci-jobs` -- :doc:`jjb/lf-macros` -- :doc:`jjb/lf-maven-jobs` -- :doc:`jjb/lf-node-jobs` -- :doc:`jjb/lf-python-jobs` -- :doc:`jjb/lf-rtd-jobs` +.. toctree:: + :maxdepth: 1 + + jjb/lf-ci-jobs + jjb/lf-macros + jjb/lf-maven-jobs + jjb/lf-node-jobs + jjb/lf-python-jobs + jjb/lf-rtd-jobs Indices and tables ================== diff --git a/docs/jjb/lf-macros.rst b/docs/jjb/lf-macros.rst index a5da00d3..72d898c6 100644 --- a/docs/jjb/lf-macros.rst +++ b/docs/jjb/lf-macros.rst @@ -118,7 +118,7 @@ Call pip install to install packages into a virtualenv located in .. note:: The first package listed in PIP_PACKAGES is used as the VENV name. -.. _lf-provide-maven-settings +.. _lf-provide-maven-settings: lf-provide-maven-settings ------------------------- diff --git a/docs/jjb/lf-python-jobs.rst b/docs/jjb/lf-python-jobs.rst index 2a8e66b7..980e8678 100644 --- a/docs/jjb/lf-python-jobs.rst +++ b/docs/jjb/lf-python-jobs.rst @@ -41,6 +41,103 @@ Runs a shell script that installs tox in a Python virtualenv. Job Templates ============= +Python XC CLM +------------- + +CLM scans for Python based repos. This job will call the Nexus IQ CLI +directly to run the scans. + +A new credential named "nexus-iq-xc-clm" needs to exist in the Jenkins credentials. +The credential should contain the username and password to access Nexus +IQ Server. + +:Template Names: + + - {project-name}-python-clm-{stream} + - gerrit-python-xc-clm + - github-python-xc-clm + +:Required parameters: + + :build-node: The node to run build on. + :jenkins-ssh-credential: Credential to use for SSH. (Generally should + get configured in defaults.yaml) + +:Optional parameters: + + :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7) + :nexus-iq-cli-version: Nexus IQ CLI package version to download and use. (default: 1.44.0-01) + :build-timeout: Timeout in seconds before aborting build. (default: 60) + :git-url: URL clone project from. (default: $GIT_URL/$PROJECT) + :java-version: Version of Java to use for the build. (default: openjdk8) + :stream: Keyword used to represent a release code-name. + Often the same as the branch. (default: master) + :submodule-recursive: Whether to checkout submodules recursively. + (default: true) + :gerrit_clm_triggers: Override Gerrit Triggers. + +Python Sonar with Tox +--------------------- + +Sonar scans for Python based repos. This job will perform a tox call which +runs the coverage command to gather tests results. These test results get +published back into Sonar after running the Sonar goals. + +To get the Sonar coverage results, tox.ini needs to exist and configured +with coverage commands to run. + +The coverage commands define the code that gets executed by the test suites. +It does not guarantee that the code tests executed properly, but it will help +pointing out the code that is not tested at all. + +For example: + +.. code-block:: bash + + [testenv:py27] + commands = + coverage run --module pytest --junitxml xunit-results.xml + coverage xml --omit=".tox/py27/*","tests/*" + coverage report --omit=".tox/py27/*","tests/*" + +For more details refer to coverage and sonar documentation: + +https://coverage.readthedocs.io/ + +https://docs.sonarqube.org/display/PLUG/Python+Coverage+Results+Import + +:Template Names: + + - {project-name}-tox-sonar + - gerrit-tox-sonar + - github-tox-sonar + +:Required parameters: + + :build-node: The node to run build on. + :jenkins-ssh-credential: Credential to use for SSH. (Generally should + get configured in defaults.yaml) + :mvn-settings: The name of settings file containing credentials for the project. + +:Optional parameters: + + :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7) + :build-timeout: Timeout in seconds before aborting build. (default: 60) + :cron: Cron schedule when to trigger the job. This parameter also + supports multiline input via YAML pipe | character in cases where + one may want to provide more than 1 cron timer. (default: H 11 * * * + to run once a day) + :git-url: URL clone project from. (default: $GIT_URL/$PROJECT) + :java-version: Version of Java to use for the build. (default: openjdk8) + :mvn-global-settings: The name of the Maven global settings to use for + Maven configuration. (default: global-settings) + :mvn-version: Version of maven to use. (default: mvn33) + :stream: Keyword used to represent a release code-name. + Often the same as the branch. (default: master) + :submodule-recursive: Whether to checkout submodules recursively. + (default: true) + :gerrit_sonar_triggers: Override Gerrit Triggers. + Tox Verify ---------- diff --git a/docs/jjb/lf-rtd-jobs.rst b/docs/jjb/lf-rtd-jobs.rst index 8f85f1a9..780fd626 100644 --- a/docs/jjb/lf-rtd-jobs.rst +++ b/docs/jjb/lf-rtd-jobs.rst @@ -44,7 +44,24 @@ Job Templates ReadTheDocs Merge ----------------- -Merge job which triggers a POST of the docs project to readthedocs +Merge job which triggers a POST of the docs project to readthedocs. + +To use this job first configure the ``Generic API incoming webhook`` in +ReadTheDocs. To do that follow these steps: + +#. Browse to https://readthedocs.org/dashboard/PROJECT/integrations/ +#. Click on ``Generic API incoming webhook`` + + .. note:: + + If not available click on ``Add integration`` and add the + ``Generic API incoming webhook``. + +#. Copy the custom webhook URL, this is your ``rtd-build-url`` + + For example: https://readthedocs.org/api/v2/webhook/opendaylight/32321/ + +#. Copy the token, this is your ``rtd-token`` :Template Names: - {project-name}-rtd-merge-{stream} @@ -56,7 +73,12 @@ Merge job which triggers a POST of the docs project to readthedocs :build-node: The node to run build on. :jenkins-ssh-credential: Credential to use for SSH. (Generally set in defaults.yaml) - :rtd-project: This is the name of the project on ReadTheDocs.org. + :rtd-build-url: This is the generic webhook url from readthedocs.org. Refer + to the above instructions to generate one. + (Check Admin > Integrations > Generic API incoming webhook) + :rtd-token: The unique token for the project Generic webhook. Refer + to the above instructions to generate one. + (Check Admin > Integrations > Generic API incoming webhook) :Optional parameters: diff --git a/jjb/lf-ci-jobs.yaml b/jjb/lf-ci-jobs.yaml index fc49f524..5655a2b5 100644 --- a/jjb/lf-ci-jobs.yaml +++ b/jjb/lf-ci-jobs.yaml @@ -20,7 +20,7 @@ - job-group: name: '{project-name}-packer-jobs' - packer-version: 1.1.3 + packer-version: 1.2.2 jobs: - gerrit-packer-merge @@ -30,7 +30,7 @@ - job-group: name: '{project-name}-github-packer-jobs' - packer-version: 1.1.3 + packer-version: 1.2.2 jobs: - github-packer-merge @@ -141,7 +141,7 @@ branch: master build-timeout: 10 - jjb-version: 1.6.2 + jjb-version: 2.0.5 stream: master submodule-recursive: true diff --git a/jjb/lf-macros.yaml b/jjb/lf-macros.yaml index c7b7fb2f..11a827de 100644 --- a/jjb/lf-macros.yaml +++ b/jjb/lf-macros.yaml @@ -198,7 +198,9 @@ name: lf-rtd-trigger-build builders: - inject: - properties-content: RTD_PROJECT={rtd-project} + properties-content: | + RTD_BUILD_URL={rtd-build-url} + RTD_TOKEN={rtd-token} - shell: !include-raw-escape: ../shell/rtd-trigger-build.sh - builder: diff --git a/jjb/lf-python-jobs.yaml b/jjb/lf-python-jobs.yaml index 671eaf9b..fecaeff4 100644 --- a/jjb/lf-python-jobs.yaml +++ b/jjb/lf-python-jobs.yaml @@ -36,7 +36,7 @@ - inject: properties-content: 'CLM_PROJECT_NAME={clm-project-name}' - shell: !include-raw-escape: - - ../shell/sonar-cli.sh + - ../shell/nexus-iq-cli.sh #################### # COMMON FUNCTIONS # @@ -51,10 +51,7 @@ archive-artifacts: > **/*.log - **/hs_err_*.log - **/target/**/feature.xml - **/target/failsafe-reports/failsafe-summary.xml - **/target/surefire-reports/*-output.txt + nexus-iq-cli-version: 1.44.0-01 ##################### # Job Configuration # @@ -73,14 +70,6 @@ branch: '{branch}' stream: '{stream}' lftools-version: '{lftools-version}' - - string: - name: NEXUS_IQ_CLI_JAR - default: nexus-iq-cli-1.44.0-01.jar - description: Nexus IQ CLI package to download and use. - - string: - name: ARCHIVE_ARTIFACTS - default: '{archive-artifacts}' - description: Artifacts to archive to the logs server. wrappers: - lf-infra-wrappers: @@ -112,12 +101,18 @@ gerrit_clm_triggers: - comment-added-contains-event: - comment-contains-value: run-xc-clm$ + comment-contains-value: run-clm$ ##################### # Job Configuration # ##################### + parameters: + - string: + name: NEXUS_IQ_CLI_VERSION + default: '{nexus-iq-cli-version}' + description: Nexus IQ CLI package to download and use. + triggers: # Build weekly on Saturdays - timed: 'H H * * 6' @@ -138,7 +133,7 @@ wrappers: - credentials-binding: - username-password-separated: - credential-id: sonar-xc-clm + credential-id: nexus-iq-xc-clm username: CLM_USER password: CLM_PASSWORD builders: @@ -185,7 +180,7 @@ triggers: - lf-infra-github-pr-trigger: - trigger-phrase: '^run-xc-clm$' + trigger-phrase: '^run-clm$' only-trigger-phrase: false status-context: 'CLM' permit-all: true @@ -196,6 +191,166 @@ github_pr_admin_list: - '' +######################## +# Python Sonar with Tox # +######################## + +- lf_tox_sonar: &lf_tox_sonar + name: lf-tox_sonar + + ###################### + # Default parameters # + ###################### + + branch: master # Sonar should always be run on master branch + build-days-to-keep: 7 + build-timeout: 60 + cron: 'H H * * *' # run daily + git-url: '$GIT_URL/$PROJECT' + java-version: openjdk8 + python-version: python2 + mvn-global-settings: global-settings + mvn-settings: '{mvn-settings}' + mvn-version: mvn33 + sonar-mvn-goal: 'sonar:sonar' + stream: master + submodule-recursive: true + + gerrit_sonar_triggers: + - comment-added-contains-event: + comment-contains-value: run-sonar$ + + ##################### + # Job Configuration # + ##################### + + parameters: + - lf-infra-parameters: + project: '{project}' + branch: '{branch}' + stream: '{stream}' + lftools-version: '{lftools-version}' + - string: + name: ARCHIVE_ARTIFACTS + default: '{archive-artifacts}' + description: Artifacts to archive to the logs server. + - string: + name: MVN + # Sets an env var for shell scripts to be able to call the dynamically + # installed maven without having to calculate the path themselves. + # yamllint disable-line rule:line-length + default: '/w/tools/hudson.tasks.Maven_MavenInstallation/{mvn-version}/bin/mvn' + description: 'Maven selector to be used by shell scripts' + - string: + name: SONAR_MAVEN_GOAL + default: '{sonar-mvn-goal}' + description: | + Maven goals to pass to the Sonar call. Typically sonar:sonar + however to use a specific version of the sonar-maven-plugin we + can call "org.codehaus.mojo:sonar-maven-plugin:3.3.0.603:sonar". + + 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: '**/master' + skip-vote: + successful: true + failed: true + unstable: true + notbuilt: true + + builders: + - shell: !include-raw-escape: + # Workaround issue where the tox run later breaks the lftools virtualenv. + # Without running the install first the run in the publisher will fail + # due to missing lftools because it gets installed into a tox venv. + - ../shell/lftools-install.sh + - lf-infra-tox-install: + python-version: '{python-version}' + - shell: !include-raw-escape: ../shell/tox-run.sh + - lf-provide-maven-settings: + global-settings-file: '{mvn-global-settings}' + settings-file: '{mvn-settings}' + - lf-infra-tox-sonar: + java-version: '{java-version}' + mvn-settings: '{mvn-settings}' + mvn-version: '{mvn-version}' + + publishers: + - lf-infra-publish + +- builder: + name: lf-infra-tox-sonar + # Run a Sonar build with Maven + builders: + - lf-maven-install: + mvn-version: '{mvn-version}' + - lf-update-java-alternatives: + java-version: '{java-version}' + - inject: + # TODO: Switch this to the sonar wrapper when JJB 2.0 is available + properties-content: SONAR_HOST_URL=$SONAR_URL + - shell: !include-raw-escape: + - ../shell/common-variables.sh + - ../shell/maven-sonar.sh + - lf-provide-maven-settings-cleanup + +- job-template: + name: '{project-name}-tox-sonar' + id: gerrit-tox-sonar + <<: *lf_python_common + # yamllint disable-line rule:key-duplicates + <<: *lf_tox_sonar + + 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}' + choosing-strategy: default + +- job-template: + name: '{project-name}-tox-sonar' + id: github-tox-sonar + <<: *lf_python_common + # yamllint disable-line rule:key-duplicates + <<: *lf_tox_sonar + + properties: + - github: + url: '{git-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}' + choosing-strategy: default + jenkins-ssh-credential: '{jenkins-ssh-credential}' + + triggers: + - lf-infra-github-pr-trigger: + trigger-phrase: '^run-sonar$' + only-trigger-phrase: false + status-context: 'Python Sonar' + permit-all: true + github-hooks: true + github-org: '' + github_pr_whitelist: + - '' + github_pr_admin_list: + - '' + ############## # Tox Verify # ############## diff --git a/jjb/lf-rtd-jobs.yaml b/jjb/lf-rtd-jobs.yaml index 20470be7..2b7ae8a7 100644 --- a/jjb/lf-rtd-jobs.yaml +++ b/jjb/lf-rtd-jobs.yaml @@ -87,7 +87,8 @@ builders: - lf-rtd-trigger-build: - rtd-project: '{rtd-project}' + rtd-build-url: '{rtd-build-url}' + rtd-token: '{rtd-token}' - job-template: name: '{project-name}-rtd-merge-{stream}' diff --git a/relnotes/v0.18.0.txt b/relnotes/v0.18.0.txt new file mode 100644 index 00000000..54df9ccf --- /dev/null +++ b/relnotes/v0.18.0.txt @@ -0,0 +1,82 @@ +global-jjb v0.18.0 Release Notes +================================ + +Thanks to Anil, Jeremy, Jessica, Ry, and Thanh for contributing to this release. + + +Upgrade considerations +---------------------- + +1. PostBuildScript 2.x support + +This release updates some macros that requires the PostBuildScript 2.0 plugin +or newer to be installed in Jenkins and JJB 2.0.3 or newer to be installed for +the jjb-verify and jjb-merge jobs. + +2. ReadTheDocs (RTD) merge job updated for RTD v2 API + +The rtd-merge now replaces the previous ``rtd-project`` parameter with 2 new +parameters ``rtd-build-url`` and ``rtd-token``. This is to support the newer +RTD v2 API which no longer allows anonymous triggering of builds in RTD. + +Refer to the rtd-merge job documentation for details: +http://docs.releng.linuxfoundation.org/projects/global-jjb/en/latest/jjb/lf-rtd-jobs.html#readthedocs-merge + + +Notable changes since v0.17.0 +----------------------------- + +f76c82a Thanh Ha Support PostBuildScript 2.x +PostBuildScript 2.x in Jenkins is now supported by global-jjb allowing us to +move off of the older and no longer supported 1.x release of the plugin. + +841f374 Thanh Ha Add support for VolumeFromImage boot source +The OpenStack cloud plugin version 2.32 adds support for allowing us to set +the volume size of a minion from the plugin. global-jjb now supports this as +well via the jenkins-cfg job. + +Refer to the jenkins-cfg job documentation for full details: +http://docs.releng.linuxfoundation.org/projects/global-jjb/en/latest/jjb/lf-ci-jobs.html#jenkins-configuration-merge + +ad0ee7c Ry Jones Fix pip version to 9.0.3 +We now pin all global-jjb pip dependencies to version 9.0.3 as upstream's +latest 10.0.0 release is a major change that breaks several of our jobs. + +b020128 Jeremy Phelps Update RTD to use Generic API v2 webhook +Adds support for RTD's Generic API v2 which no longer allows anonymous build +triggering and requires a build url + token for each project. + +d859830 Jessica Wagantall Add lf_tox_sonar job +Adds a python-sonar job that can be used by Python projects to generate sonar +reports. + +379003e Jessica Wagantall Update comment triggers XC CLM +Python CLM triggers were changed to "run-clm" to match existing similar jobs. + + +Full Change Log +--------------- + +4e5067d Anil Belur Update packer version to 1.2.2 +379003e Jessica Wagantall Update comment triggers XC CLM +536325e Thanh Ha Add new odl- flavors to cloud list +eaa48f8 Anil Belur Update JJB version 2.0.5 +9f237eb Thanh Ha Replace pipdeptree with pip freeze +a434075 Thanh Ha Pin pip to 9.0.3 +d859830 Jessica Wagantall Add lf_tox_sonar job +be6ec04 Jeremy Phelps Update default jjb version +b020128 Jeremy Phelps Update RTD to use Generic API v2 webhook +d0059ff Thanh Ha Force rm for cleanup macro +f1fe473 Thanh Ha Fix pipconf name to the default one +ad0ee7c Ry Jones Fix pip version +81a5e9d Anil Belur Validate packer version before install +edf56a1 Jeremy Phelps Pin tox to <3.0.0 as it breaks detox +7f88f16 Thanh Ha Revert "Update RTD to use custom trigger url" +12d6179 Jeremy Phelps Update RTD to use custom trigger url +3ea6a67 Thanh Ha Add link to release notes +4d3e0b4 Thanh Ha Quit build if submodule not found +aa20551 Thanh Ha Ensure setuptools is updated +841f374 Thanh Ha Add support for VolumeFromImage boot source +f77ecf8 Anil Belur Export packer binary dir in $PATH +f76c82a Thanh Ha Support PostBuildScript 2.x +b7aabb1 Thanh Ha Document job-group defaults order of priority diff --git a/shell/gerrit-fetch-dependencies.sh b/shell/gerrit-fetch-dependencies.sh index d7f830b3..1cb51774 100644 --- a/shell/gerrit-fetch-dependencies.sh +++ b/shell/gerrit-fetch-dependencies.sh @@ -30,7 +30,7 @@ set +u # Allow unbound variables for virtualenv virtualenv --quiet "/tmp/v/git-review" # shellcheck source=/tmp/v/git-review/bin/activate disable=SC1091 source "/tmp/v/git-review/bin/activate" -pip install --quiet --upgrade pip setuptools +pip install --quiet --upgrade "pip==9.0.3" setuptools pip install --quiet --upgrade git-review set -u # End git-review workaround diff --git a/shell/jenkins-configure-clouds.sh b/shell/jenkins-configure-clouds.sh index a04c16ca..c2df0919 100644 --- a/shell/jenkins-configure-clouds.sh +++ b/shell/jenkins-configure-clouds.sh @@ -121,6 +121,13 @@ get_minion_options() { flavors["v2-highcpu-8"]="221de281-95ec-414f-8e42-c86c9e0b318d" flavors["v2-highcpu-16"]="ddd6863a-ef4f-475c-9aee-61d46898651d" flavors["v2-highcpu-32"]="21dfb8a3-c472-4a2c-a8e1-4da8de415ff8" + flavors["odl-highcpu-2"]="def1b86f-b7f8-4943-b430-4a0599170006" + flavors["odl-highcpu-4"]="0c8ec795-2ff8-4623-98cf-b4c1d92bb37c" + flavors["odl-highcpu-8"]="458d6499-e2c8-4580-aa88-a4a04a33ee25" + flavors["odl-standard-1"]="35800a3f-0c69-428d-b5cb-136d17d46c48" + flavors["odl-standard-2"]="8ead227a-acfe-4290-be70-fbab92e6dd2f" + flavors["odl-standard-4"]="f76fb18d-d5fb-4175-95c1-b29d8039d102" + flavors["odl-standard-8"]="ba38b1af-4f87-4e4e-860e-94e8329d0d78" image_name=$(get_cfg "$cfg_file" IMAGE_NAME "") volume_size=$(get_cfg "$cfg_file" VOLUME_SIZE "") diff --git a/shell/jjb-install.sh b/shell/jjb-install.sh index 54501b8e..9351f489 100644 --- a/shell/jjb-install.sh +++ b/shell/jjb-install.sh @@ -18,8 +18,7 @@ virtualenv "/tmp/v/jjb" # shellcheck source=/tmp/v/jjb/bin/activate disable=SC1091 source "/tmp/v/jjb/bin/activate" pip install --quiet --upgrade "pip==9.0.3" setuptools -pip install --quiet --upgrade pipdeptree pip install --quiet --upgrade "jenkins-job-builder==$JJB_VERSION" -echo "----> Pip Dependency Tree" -pipdeptree +echo "----> pip freeze" +pip freeze diff --git a/shell/lftools-install.sh b/shell/lftools-install.sh index c13086a7..a6792ed7 100644 --- a/shell/lftools-install.sh +++ b/shell/lftools-install.sh @@ -50,7 +50,7 @@ set -e -o pipefail virtualenv --quiet "/tmp/v/lftools" # shellcheck source=/tmp/v/lftools/bin/activate disable=SC1091 source "/tmp/v/lftools/bin/activate" -pip install --quiet --upgrade pip setuptools +pip install --quiet --upgrade "pip==9.0.3" setuptools case $LFTOOLS_MODE in gerrit) diff --git a/shell/sonar-cli.sh b/shell/nexus-iq-cli.sh similarity index 71% rename from shell/sonar-cli.sh rename to shell/nexus-iq-cli.sh index d12e6700..43021f82 100644 --- a/shell/sonar-cli.sh +++ b/shell/nexus-iq-cli.sh @@ -14,8 +14,10 @@ # the repo set +x -wget -nv https://download.sonatype.com/clm/scanner/${NEXUS_IQ_CLI_JAR} -O /tmp/${NEXUS_IQ_CLI_JAR} +CLI_LOCATION="/tmp/nexus-iq-cli-${NEXUS_IQ_CLI_VERSION}.jar" +wget -nv https://download.sonatype.com/clm/scanner/nexus-iq-cli-${NEXUS_IQ_CLI_VERSION}.jar -O ${CLI_LOCATION} echo "-a" > cli-auth.txt echo "${CLM_USER}:${CLM_PASSWORD}" >> cli-auth.txt -java -jar /tmp/${NEXUS_IQ_CLI_JAR} @cli-auth.txt -xc -i ${CLM_PROJECT_NAME} -s https://nexus-iq.wl.linuxfoundation.org -t build . +java -jar ${CLI_LOCATION} @cli-auth.txt -xc -i ${CLM_PROJECT_NAME} -s https://nexus-iq.wl.linuxfoundation.org -t build . rm cli-auth.txt +rm ${CLI_LOCATION} diff --git a/shell/node-install.sh b/shell/node-install.sh index 008b3824..da6cfe43 100644 --- a/shell/node-install.sh +++ b/shell/node-install.sh @@ -18,8 +18,7 @@ virtualenv --quiet "/tmp/v/python" # shellcheck source=/tmp/v/node/bin/activate disable=SC1091 source "/tmp/v/python/bin/activate" pip install --quiet --upgrade "pip==9.0.3" setuptools -pip install --quiet --upgrade pipdeptree pip install --quiet --upgrade nodeenv -echo "----> Pip Dependency Tree" -pipdeptree +echo "----> pip freeze" +pip freeze diff --git a/shell/packer-install.sh b/shell/packer-install.sh index 90780cbf..d59ce2ac 100644 --- a/shell/packer-install.sh +++ b/shell/packer-install.sh @@ -16,7 +16,7 @@ echo "---> packer-install.sh" set -eu -o pipefail # $PACKER_VERSION : Define a packer version passed as job paramter -PACKER_VERSION="${PACKER_VERSION:-1.1.3}" +PACKER_VERSION="${PACKER_VERSION:-1.2.2}" export PATH="${WORKSPACE}/bin:$PATH" packer_install() { diff --git a/shell/rtd-trigger-build.sh b/shell/rtd-trigger-build.sh index 21e72694..673d0f9a 100644 --- a/shell/rtd-trigger-build.sh +++ b/shell/rtd-trigger-build.sh @@ -8,16 +8,32 @@ # which accompanies this distribution, and is available at # http://www.eclipse.org/legal/epl-v10.html ############################################################################## +# Call cURL to trigger a build in RTD via the Generic API +# +# Paramters: +# RTD_BUILD_URL: The unique build URL for the project. +# Check Admin > Integrations > Generic API incoming webhook. +# +# RTD_TOKEN: The unique token for the project Generic webhook. +# Check Admin > Integrations > Generic API incoming webhook. + echo "---> rtd-trigger-build.sh" # Ensure we fail the job if any steps fail. -# DO NOT set -u -set -xe -o pipefail +# DO NOT set -u as we depend on unbound variables being passed by Jenkins. +set -e -o pipefail + +# Ensure RTD_BUILD_URL retains the trailing slash as it is needed for the API +last_char=${RTD_BUILD_URL:length-1:1} +[[ $last_char != "/" ]] && RTD_BUILD_URL="$RTD_BUILD_URL/"; : + +json=$(curl -X POST -d "branches=${GERRIT_BRANCH}" -d "token=$RTD_TOKEN" "$RTD_BUILD_URL") +build_triggered=$(echo $json | jq -r .build_triggered) -if [ "$GERRIT_BRANCH" == "master" ]; then - RTD_BUILD_VERSION=latest -else - RTD_BUILD_VERSION="${GERRIT_BRANCH/\//-}" +if [ "$build_triggered" != "true" ]; then + echo "ERROR: Build was not triggered." + echo "$json" | jq -r + exit 1 fi -curl -X POST --data "version_slug=$RTD_BUILD_VERSION" "https://readthedocs.org/build/$RTD_PROJECT" +echo "Build triggered for $GERRIT_PROJECT in ReadTheDocs." diff --git a/shell/tox-install.sh b/shell/tox-install.sh index 96c0fa38..9e50ead4 100644 --- a/shell/tox-install.sh +++ b/shell/tox-install.sh @@ -18,8 +18,7 @@ virtualenv --quiet -p "$PYTHON_VERSION" "/tmp/v/tox" # shellcheck source=/tmp/v/tox/bin/activate disable=SC1091 source "/tmp/v/tox/bin/activate" pip install --quiet --upgrade "pip==9.0.3" setuptools -pip install --quiet --upgrade pipdeptree pip install --quiet --upgrade argparse detox "tox<3.0.0" tox-pyenv -echo "----> Pip Dependency Tree" -pipdeptree +echo "----> pip freeze" +pip freeze diff --git a/tox.ini b/tox.ini index 69381d08..4d0f0f92 100644 --- a/tox.ini +++ b/tox.ini @@ -19,7 +19,7 @@ commands = [testenv:docs] deps = -rrequirements.txt commands = - sphinx-build -b html -n -d {envtmpdir}/doctrees ./docs/ {toxinidir}/docs/_build/html + sphinx-build -W -b html -n -d {envtmpdir}/doctrees ./docs/ {toxinidir}/docs/_build/html echo "Generated docs available in {toxinidir}/docs/_build/html" whitelist_externals = echo @@ -29,7 +29,7 @@ commands = [testenv:jjb] deps = - jenkins-job-builder>=2.0.3 + jenkins-job-builder>=2.0.5 commands = jenkins-jobs -l DEBUG test --recursive -o {toxinidir}/archives/job-configs {toxinidir}/jjb:{toxinidir}/.jjb-test