From ebe111f73372695ac4c52529d4346840763e1811 Mon Sep 17 00:00:00 2001 From: Ward Vandewege Date: Tue, 6 Jul 2021 17:23:15 -0400 Subject: [PATCH] Allow building a wb2 jenkins image from a specific wb2 git commit. refs #17782 Arvados-DCO-1.1-Signed-off-by: Ward Vandewege --- jenkins/packer-images/jenkins-image-workbench2.json | 6 +++++- jenkins/packer-images/jenkins-image-workbench2.sh | 7 ++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/jenkins/packer-images/jenkins-image-workbench2.json b/jenkins/packer-images/jenkins-image-workbench2.json index 0f2aaf1..ca0c751 100644 --- a/jenkins/packer-images/jenkins-image-workbench2.json +++ b/jenkins/packer-images/jenkins-image-workbench2.json @@ -1,6 +1,7 @@ { "variables": { - "key_file": "{{env `packerbuildkey`}}" + "key_file": "{{env `packerbuildkey`}}", + "git_hash": "{{env `git_hash`}}" }, "builders": [ { @@ -31,6 +32,9 @@ }, { "type": "shell", + "environment_vars": [ + "GIT_HASH={{ user `git_hash` }}" + ], "script": "./jenkins-image-workbench2.sh" } ] diff --git a/jenkins/packer-images/jenkins-image-workbench2.sh b/jenkins/packer-images/jenkins-image-workbench2.sh index a345d77..033c7f8 100755 --- a/jenkins/packer-images/jenkins-image-workbench2.sh +++ b/jenkins/packer-images/jenkins-image-workbench2.sh @@ -9,9 +9,14 @@ set -eo pipefail # Get the wb2 repository cd /usr/src sudo git clone https://git.arvados.org/arvados-workbench2.git +cd arvados-workbench2 + +if [[ "$GIT_HASH" != "" ]]; then + echo "GIT_HASH is set to $GIT_HASH, checking out that revision..." + sudo git checkout $GIT_HASH +fi # Build the workbench2-build docker image -cd arvados-workbench2 sudo make workbench2-build-image cd .. -- 2.30.2