Update jobs to use lf-infra-pre-build 98/12598/1
authorThanh Ha <thanh.ha@linuxfoundation.org>
Thu, 13 Sep 2018 23:38:34 +0000 (19:38 -0400)
committerThanh Ha <thanh.ha@linuxfoundation.org>
Fri, 14 Sep 2018 02:14:16 +0000 (22:14 -0400)
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 <thanh.ha@linuxfoundation.org>
15 files changed:
jjb/lf-ci-jobs.yaml
jjb/lf-maven-jobs.yaml
jjb/lf-python-jobs.yaml
releasenotes/notes/local-user-pip-9e1dc49e756add97.yaml [new file with mode: 0644]
shell/jenkins-configure-clouds.sh
shell/jenkins-configure-global-vars.sh
shell/jjb-cleanup.sh
shell/jjb-install.sh
shell/maven-build-deps.sh
shell/maven-build.sh
shell/maven-fetch-metadata.sh
shell/maven-javadoc-generate.sh
shell/maven-patch-release.sh
shell/maven-sonar.sh
shell/maven-stage.sh

index e9e483e..f8b7b77 100644 (file)
       - 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
       - 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
           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:
     #####################
 
     builders:
+      - lf-infra-pre-build
       - lf-infra-jjbini
       - shell: !include-raw-escape:
           - ../shell/jjb-install.sh
     concurrent: true
 
     builders:
+      - lf-infra-pre-build
       - lf-infra-jjbini
       - shell: !include-raw-escape:
           - ../shell/git-validate-jira-urls.sh
index 78ef2f6..eec2bdb 100644 (file)
     disabled: '{disable-job}'
 
     builders:
+      - lf-infra-pre-build
       - lf-maven-install:
           mvn-version: '{mvn-version}'
       - lf-update-java-alternatives:
     disabled: '{disable-job}'
 
     builders:
+      - lf-infra-pre-build
       - lf-maven-install:
           mvn-version: '{mvn-version}'
       - lf-update-java-alternatives:
       - 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
 
     disabled: '{disable-job}'
 
     builders:
+      - lf-infra-pre-build
       - lf-maven-install:
           mvn-version: '{mvn-version}'
       - lf-update-java-alternatives:
     disabled: '{disable-job}'
 
     builders:
+      - lf-infra-pre-build
       - lf-jacoco-nojava-workaround
       - lf-maven-install:
           mvn-version: '{mvn-version}'
           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
           description: Nexus staging profile ID.
 
     builders:
+      - lf-infra-pre-build
       - lf-jacoco-nojava-workaround
       - lf-maven-install:
           mvn-version: '{mvn-version}'
           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:
             notbuilt: true
 
     builders:
+      - lf-infra-pre-build
       - lf-infra-maven-sonar:
           java-version: '{java-version}'
           mvn-settings: '{mvn-settings}'
     disabled: '{disable-job}'
 
     builders:
+      - lf-infra-pre-build
       - lf-jacoco-nojava-workaround
       - lf-maven-install:
           mvn-version: '{mvn-version}'
       - 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
     disabled: '{disable-job}'
 
     builders:
+      - lf-infra-pre-build
       - lf-jacoco-nojava-workaround
       - lf-maven-install:
           mvn-version: '{mvn-version}'
index c3bd91b..7c3251a 100644 (file)
               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 (file)
index 0000000..7056387
--- /dev/null
@@ -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.
index 456b825..44da8f4 100644 (file)
@@ -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"
index de45f90..2ebdcee 100644 (file)
@@ -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
index 9f3536a..69d1534 100644 (file)
@@ -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
index 86fbef7..baaa5d7 100644 (file)
@@ -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
index 3ff3f24..8583d90 100644 (file)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/bash -l
 # SPDX-License-Identifier: EPL-1.0
 ##############################################################################
 # Copyright (c) 2017 The Linux Foundation and others.
index c00aa06..1f61954 100644 (file)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/bash -l
 # SPDX-License-Identifier: EPL-1.0
 ##############################################################################
 # Copyright (c) 2017 The Linux Foundation and others.
index ebffa96..26b2c96 100644 (file)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/bash -l
 # SPDX-License-Identifier: EPL-1.0
 ##############################################################################
 # Copyright (c) 2017 The Linux Foundation and others.
index 891f60b..7919242 100644 (file)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/bash -l
 # SPDX-License-Identifier: EPL-1.0
 ##############################################################################
 # Copyright (c) 2017 The Linux Foundation and others.
index cc3c8b8..d7c4577 100644 (file)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/bash -l
 # SPDX-License-Identifier: EPL-1.0
 ##############################################################################
 # Copyright (c) 2017 The Linux Foundation and others.
index e0c0477..5857234 100644 (file)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/bash -l
 # SPDX-License-Identifier: EPL-1.0
 ##############################################################################
 # Copyright (c) 2017 The Linux Foundation and others.
index bcac7f6..ea8652d 100644 (file)
@@ -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"