From: Thanh Ha Date: Thu, 13 Sep 2018 23:38:34 +0000 (-0400) Subject: Update jobs to use lf-infra-pre-build X-Git-Tag: v0.25.0~8 X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F98%2F12598%2F1;p=releng%2Fglobal-jjb.git Update jobs to use lf-infra-pre-build Use lf-infra-pre-build to install lftools via --user config. This resolves the post-build issues caused by `pip install` due to virtualenvs messing with the environment. Change-Id: Iccd72e6f1d580037f55bff3199d05d467de17c58 Signed-off-by: Thanh Ha --- diff --git a/jjb/lf-ci-jobs.yaml b/jjb/lf-ci-jobs.yaml index e9e483ea..f8b7b775 100644 --- a/jjb/lf-ci-jobs.yaml +++ b/jjb/lf-ci-jobs.yaml @@ -236,7 +236,7 @@ - inject: properties-content: 'jenkins_silos={jenkins-silos}' - shell: !include-raw-escape: ../shell/jenkins-configure-clouds.sh - - shell: rm "$HOME/.config/jenkins_jobs/jenkins_jobs.ini" + - shell: rm -f "$HOME/.config/jenkins_jobs/jenkins_jobs.ini" - builder: name: lf-jenkins-cfg-global-vars @@ -245,7 +245,7 @@ - inject: properties-content: 'jenkins_silos={jenkins-silos}' - shell: !include-raw-escape: ../shell/jenkins-configure-global-vars.sh - - shell: rm "$HOME/.config/jenkins_jobs/jenkins_jobs.ini" + - shell: rm -f "$HOME/.config/jenkins_jobs/jenkins_jobs.ini" - lf_jenkins_configuration: &lf_jenkins_cfg_merge name: lf-jenkins-cfg-merge @@ -301,8 +301,7 @@ jenkins-ssh-credential: '{jenkins-ssh-credential}' builders: - - shell: !include-raw-escape: - - ../shell/lftools-install.sh + - lf-infra-pre-build - lf-jenkins-cfg-global-vars: jenkins-silos: '{jenkins-silos}' - lf-jenkins-cfg-clouds: @@ -572,6 +571,7 @@ ##################### builders: + - lf-infra-pre-build - lf-infra-jjbini - shell: !include-raw-escape: - ../shell/jjb-install.sh @@ -680,6 +680,7 @@ concurrent: true builders: + - lf-infra-pre-build - lf-infra-jjbini - shell: !include-raw-escape: - ../shell/git-validate-jira-urls.sh diff --git a/jjb/lf-maven-jobs.yaml b/jjb/lf-maven-jobs.yaml index 78ef2f64..eec2bdbc 100644 --- a/jjb/lf-maven-jobs.yaml +++ b/jjb/lf-maven-jobs.yaml @@ -159,6 +159,7 @@ disabled: '{disable-job}' builders: + - lf-infra-pre-build - lf-maven-install: mvn-version: '{mvn-version}' - lf-update-java-alternatives: @@ -287,6 +288,7 @@ disabled: '{disable-job}' builders: + - lf-infra-pre-build - lf-maven-install: mvn-version: '{mvn-version}' - lf-update-java-alternatives: @@ -301,7 +303,6 @@ - shell: !include-raw-escape: - ../shell/common-variables.sh - ../shell/maven-javadoc-generate.sh - - ../shell/lftools-install.sh - ../shell/maven-javadoc-publish.sh - lf-provide-maven-settings-cleanup @@ -415,6 +416,7 @@ disabled: '{disable-job}' builders: + - lf-infra-pre-build - lf-maven-install: mvn-version: '{mvn-version}' - lf-update-java-alternatives: @@ -536,6 +538,7 @@ disabled: '{disable-job}' builders: + - lf-infra-pre-build - lf-jacoco-nojava-workaround - lf-maven-install: mvn-version: '{mvn-version}' @@ -550,9 +553,7 @@ properties-content: | NEXUS_CUT_DIRS={nexus-cut-dirs} NEXUS_REPO={nexus-snapshot-repo} - - shell: !include-raw-escape: - - ../shell/lftools-install.sh - - ../shell/maven-fetch-metadata.sh + - shell: !include-raw-escape: ../shell/maven-fetch-metadata.sh - lf-maven-build: mvn-goals: '{mvn-goals}' - lf-maven-deploy @@ -693,6 +694,7 @@ description: Nexus staging profile ID. builders: + - lf-infra-pre-build - lf-jacoco-nojava-workaround - lf-maven-install: mvn-version: '{mvn-version}' @@ -703,9 +705,7 @@ settings-file: '{mvn-settings}' - lf-infra-create-netrc: server-id: '{mvn-staging-id}' - - shell: !include-raw-escape: - - ../shell/lftools-install.sh - - ../shell/maven-patch-release.sh + - shell: !include-raw-escape: ../shell/maven-patch-release.sh - lf-maven-build: mvn-goals: '{mvn-goals}' - lf-sigul-sign-dir: @@ -852,6 +852,7 @@ notbuilt: true builders: + - lf-infra-pre-build - lf-infra-maven-sonar: java-version: '{java-version}' mvn-settings: '{mvn-settings}' @@ -980,6 +981,7 @@ disabled: '{disable-job}' builders: + - lf-infra-pre-build - lf-jacoco-nojava-workaround - lf-maven-install: mvn-version: '{mvn-version}' @@ -988,8 +990,6 @@ - lf-provide-maven-settings: global-settings-file: '{mvn-global-settings}' settings-file: '{mvn-settings}' - - shell: !include-raw-escape: - - ../shell/lftools-install.sh - lf-maven-build: mvn-goals: '{mvn-goals}' - lf-provide-maven-settings-cleanup @@ -1101,6 +1101,7 @@ disabled: '{disable-job}' builders: + - lf-infra-pre-build - lf-jacoco-nojava-workaround - lf-maven-install: mvn-version: '{mvn-version}' diff --git a/jjb/lf-python-jobs.yaml b/jjb/lf-python-jobs.yaml index c3bd91bb..7c3251a5 100644 --- a/jjb/lf-python-jobs.yaml +++ b/jjb/lf-python-jobs.yaml @@ -267,11 +267,7 @@ can call "org.codehaus.mojo:sonar-maven-plugin:3.3.0.603:sonar". 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-pre-build - lf-infra-tox-install: python-version: '{python-version}' - shell: !include-raw-escape: ../shell/tox-run.sh diff --git a/releasenotes/notes/local-user-pip-9e1dc49e756add97.yaml b/releasenotes/notes/local-user-pip-9e1dc49e756add97.yaml new file mode 100644 index 00000000..70563879 --- /dev/null +++ b/releasenotes/notes/local-user-pip-9e1dc49e756add97.yaml @@ -0,0 +1,6 @@ +--- +fixes: + - | + Fix jobs failing with UNSTABLE build due to install pip==18.0 missing. + This change moves all the jobs to using lf-infra-pre-build to install + lftools via --user command. diff --git a/shell/jenkins-configure-clouds.sh b/shell/jenkins-configure-clouds.sh index 456b825a..44da8f4d 100644 --- a/shell/jenkins-configure-clouds.sh +++ b/shell/jenkins-configure-clouds.sh @@ -36,9 +36,6 @@ if [ ! -d "$WORKSPACE/jenkins-config/clouds" ]; then exit 0 fi -#shellcheck source=/tmp/v/lftools/bin/activate disable=SC1091 -source "/tmp/v/lftools/bin/activate" - GROOVY_SCRIPT_FILE="jjb/global-jjb/jenkins-admin/manage_clouds.groovy" OS_CLOUD_DIR="$WORKSPACE/jenkins-config/clouds/openstack" SCRIPT_DIR="$WORKSPACE/archives/groovy-inserts" diff --git a/shell/jenkins-configure-global-vars.sh b/shell/jenkins-configure-global-vars.sh index de45f907..2ebdceea 100644 --- a/shell/jenkins-configure-global-vars.sh +++ b/shell/jenkins-configure-global-vars.sh @@ -20,8 +20,6 @@ echo "---> jenkins-configure-global-vars.sh" GROOVY_SCRIPT_FILE="jjb/global-jjb/jenkins-admin/set_global_properties.groovy" -# shellcheck source=/tmp/v/lftools/bin/activate disable=SC1091 -source "/tmp/v/lftools/bin/activate" silos="${jenkins_silos:-jenkins}" set -eu -o pipefail diff --git a/shell/jjb-cleanup.sh b/shell/jjb-cleanup.sh index 9f3536a3..69d1534b 100644 --- a/shell/jjb-cleanup.sh +++ b/shell/jjb-cleanup.sh @@ -20,7 +20,8 @@ set -e -o pipefail # shellcheck source="$WORKSPACE/.jjb.properties" disable=SC1091 source "$WORKSPACE/.jjb.properties" if [[ -n "$JJB_VENV" && "$JJB_VENV" =~ /tmp/.* ]]; then - rm -r "$JJB_VENV" && echo "$JJB_VENV removed" + rm -rf "$JJB_VENV" && echo "$JJB_VENV removed" unset JJB_VENV fi -rm "$WORKSPACE/.jjb.properties" +rm -f "$WORKSPACE/.jjb.properties" +deactivate diff --git a/shell/jjb-install.sh b/shell/jjb-install.sh index 86fbef71..baaa5d70 100644 --- a/shell/jjb-install.sh +++ b/shell/jjb-install.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash -l # SPDX-License-Identifier: EPL-1.0 ############################################################################## # Copyright (c) 2017 The Linux Foundation and others. @@ -22,8 +22,7 @@ virtualenv "$JJB_VENV" echo "JJB_VENV=$JJB_VENV" > "$WORKSPACE/.jjb.properties" # shellcheck source=$VENV_DIR/bin/activate disable=SC1091 source "$JJB_VENV/bin/activate" -pip install --quiet --upgrade "pip==9.0.3" setuptools -pip install --quiet --upgrade "jenkins-job-builder==$JJB_VERSION" +python -m pip install --quiet --upgrade "jenkins-job-builder==$JJB_VERSION" echo "----> pip freeze" pip freeze diff --git a/shell/maven-build-deps.sh b/shell/maven-build-deps.sh index 3ff3f24f..8583d90a 100644 --- a/shell/maven-build-deps.sh +++ b/shell/maven-build-deps.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash -l # SPDX-License-Identifier: EPL-1.0 ############################################################################## # Copyright (c) 2017 The Linux Foundation and others. diff --git a/shell/maven-build.sh b/shell/maven-build.sh index c00aa06f..1f619546 100644 --- a/shell/maven-build.sh +++ b/shell/maven-build.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash -l # SPDX-License-Identifier: EPL-1.0 ############################################################################## # Copyright (c) 2017 The Linux Foundation and others. diff --git a/shell/maven-fetch-metadata.sh b/shell/maven-fetch-metadata.sh index ebffa96f..26b2c96e 100644 --- a/shell/maven-fetch-metadata.sh +++ b/shell/maven-fetch-metadata.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash -l # SPDX-License-Identifier: EPL-1.0 ############################################################################## # Copyright (c) 2017 The Linux Foundation and others. diff --git a/shell/maven-javadoc-generate.sh b/shell/maven-javadoc-generate.sh index 891f60bc..7919242c 100644 --- a/shell/maven-javadoc-generate.sh +++ b/shell/maven-javadoc-generate.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash -l # SPDX-License-Identifier: EPL-1.0 ############################################################################## # Copyright (c) 2017 The Linux Foundation and others. diff --git a/shell/maven-patch-release.sh b/shell/maven-patch-release.sh index cc3c8b83..d7c4577a 100644 --- a/shell/maven-patch-release.sh +++ b/shell/maven-patch-release.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash -l # SPDX-License-Identifier: EPL-1.0 ############################################################################## # Copyright (c) 2017 The Linux Foundation and others. diff --git a/shell/maven-sonar.sh b/shell/maven-sonar.sh index e0c0477d..58572341 100644 --- a/shell/maven-sonar.sh +++ b/shell/maven-sonar.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash -l # SPDX-License-Identifier: EPL-1.0 ############################################################################## # Copyright (c) 2017 The Linux Foundation and others. diff --git a/shell/maven-stage.sh b/shell/maven-stage.sh index bcac7f65..ea8652dc 100644 --- a/shell/maven-stage.sh +++ b/shell/maven-stage.sh @@ -18,8 +18,6 @@ # Ensure we fail the job if any steps fail. set -xeu -o pipefail -lftools_activate - TMP_FILE="$(mktemp)" lftools deploy nexus-stage "$NEXUS_URL" "$STAGING_PROFILE_ID" "$WORKSPACE/m2repo" | tee "$TMP_FILE" staging_repo=$(sed -n -e 's/Staging repository \(.*\) created\./\1/p' "$TMP_FILE") @@ -29,4 +27,4 @@ mkdir -p "$WORKSPACE/archives" echo "$staging_repo" > "$WORKSPACE/archives/staging-repo.txt" # Cleanup -rm "$TMP_FILE" +rm -f "$TMP_FILE"