From 60508d5e144510a42b18af7a8bb6956a08521572 Mon Sep 17 00:00:00 2001 From: Tim Johnson Date: Mon, 13 Jan 2020 13:21:18 -0800 Subject: [PATCH] Python2/3 problem in jjb-deploy job Removed ref of macro: lf-pip-install from macro: lf_jjb_deploy_job. A call to lf-activate-venv() has beed added to jjb-deploy-job.sh to install jenkins-jobs command. The pip-install.sh is no longer needed. ISSUE: IT-18720 Change-Id: Ice1e9793f131eace41a3df9bbbe598aac071c1df Signed-off-by: Tim Johnson --- jjb/lf-ci-jobs.yaml | 2 -- jjb/lf-macros.yaml | 7 ------- .../notes/update-jjb-deploy-job-0802fb0d7e47726d.yaml | 11 +++++++++++ shell/jjb-deploy-job.sh | 9 ++++++--- 4 files changed, 17 insertions(+), 12 deletions(-) create mode 100644 releasenotes/notes/update-jjb-deploy-job-0802fb0d7e47726d.yaml diff --git a/jjb/lf-ci-jobs.yaml b/jjb/lf-ci-jobs.yaml index 701898c9..59045b6b 100644 --- a/jjb/lf-ci-jobs.yaml +++ b/jjb/lf-ci-jobs.yaml @@ -630,8 +630,6 @@ jenkins-ssh-credential: "{jenkins-ssh-credential}" builders: - - lf-pip-install: - pip-packages: jenkins-job-builder - lf-infra-jjbini - shell: !include-raw-escape: ../shell/jjb-deploy-job.sh diff --git a/jjb/lf-macros.yaml b/jjb/lf-macros.yaml index 6d192bf4..8961184f 100644 --- a/jjb/lf-macros.yaml +++ b/jjb/lf-macros.yaml @@ -233,13 +233,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: diff --git a/releasenotes/notes/update-jjb-deploy-job-0802fb0d7e47726d.yaml b/releasenotes/notes/update-jjb-deploy-job-0802fb0d7e47726d.yaml new file mode 100644 index 00000000..c3a05e8d --- /dev/null +++ b/releasenotes/notes/update-jjb-deploy-job-0802fb0d7e47726d.yaml @@ -0,0 +1,11 @@ +--- +fixes: + - | + The jjb-deploy-job.sh was 'activating' a venv that was created by + pip-install.sh in /tmp/v. This venv was based on python2. Now + jjb-deploy-job.sh calls lf-activate-venv() to install jenkins-jobs in a + venv based on python3. +upgrade: + - | + The lf-pip-install builder macro has been deleted. At some point we will + also be deleting shell/pip-install.sh. diff --git a/shell/jjb-deploy-job.sh b/shell/jjb-deploy-job.sh index 5efb9f48..152a02e1 100644 --- a/shell/jjb-deploy-job.sh +++ b/shell/jjb-deploy-job.sh @@ -14,10 +14,13 @@ echo "---> jjb-deploy-job.sh" # Ensure we fail the job if any steps fail. -set -e -o pipefail +set -uef -o pipefail -# shellcheck source=/tmp/v/jenkins-job-builder/bin/activate disable=SC1091 -source "/tmp/v/jenkins-job-builder/bin/activate" +# shellcheck disable=SC1090 +source ~/lf-env.sh + +# Version controlled by JJB_VERSION +lf-activate-venv jenkins-job-builder # Fetch patch if gerrit project matches the jjb-deploy project if [ "${GERRIT_PROJECT}" == "${PROJECT}" ]; then -- 2.16.6