Allow building a wb2 jenkins image from a specific wb2 git commit.
authorWard Vandewege <ward@curii.com>
Tue, 6 Jul 2021 21:23:15 +0000 (17:23 -0400)
committerWard Vandewege <ward@curii.com>
Tue, 6 Jul 2021 21:23:15 +0000 (17:23 -0400)
refs #17782

Arvados-DCO-1.1-Signed-off-by: Ward Vandewege <ward@curii.com>

jenkins/packer-images/jenkins-image-workbench2.json
jenkins/packer-images/jenkins-image-workbench2.sh

index 0f2aaf194eabd10feb84eb464dc6cbc8205f6801..ca0c7516b49caf9470fbf432d2e9f692eecd7aa7 100644 (file)
@@ -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"
     }
   ]
index a345d77d3fcfd888fcb9ab4a19c31ed69364490f..033c7f8f1c806e37011b76004c86e2b030c672c2 100755 (executable)
@@ -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 ..