17844: add a template to build an image to test the Saltstack's arvados-formula
authorJavier Bértoli <jbertoli@curii.com>
Wed, 30 Jun 2021 21:25:32 +0000 (18:25 -0300)
committerJavier Bértoli <jbertoli@curii.com>
Wed, 30 Jun 2021 21:25:32 +0000 (18:25 -0300)
Arvados-DCO-1.1-Signed-off-by: Javier Bértoli <jbertoli@curii.com>

jenkins/packer-images/README
jenkins/packer-images/jenkins-image-arvados-formula-tests.json [new file with mode: 0644]
jenkins/packer-images/jenkins-image-arvados-formula-tests.sh [new file with mode: 0755]

index 7bb3ecd5649eb8e4bd77efce01037f6e1963f1f4..c384dc316544b7448bcf1e01b36b2f06c01786b4 100644 (file)
@@ -24,3 +24,7 @@ packer build jenkins-image-with-docker.json
 
 packer build jenkins-image-k8s-tests.json
 
+*** IMAGE FOR TESTING THE ARVADOS-FORMULA ***
+
+packer build jenkins-image-arvados-formula-tests.json
+
diff --git a/jenkins/packer-images/jenkins-image-arvados-formula-tests.json b/jenkins/packer-images/jenkins-image-arvados-formula-tests.json
new file mode 100644 (file)
index 0000000..62194f1
--- /dev/null
@@ -0,0 +1,33 @@
+{
+  "variables": {
+        "key_file": "{{env `packerbuildkey`}}"
+    },
+  "builders": [
+    {
+      "type": "googlecompute",
+      "account_file": "{{user `key_file` }}",
+      "project_id": "phoenix-project-42-ci",
+      "source_image": "debian-10-buster-v20210420",
+      "zone": "us-central1-b",
+      "disk_size": "20",
+      "image_name": "jenkins-image-arvados-formula-tests-{{isotime \"20060102150405\"}}",
+      "image_family": "jenkins",
+      "ssh_username": "jenkins"
+    }
+  ],
+  "provisioners": [
+    {
+      "type": "file",
+      "source": "node-ready.sh",
+      "destination": "/tmp/node-ready.sh"
+    },
+    {
+      "type": "shell",
+      "script": "./jenkins-image-common.sh"
+    },
+    {
+      "type": "shell",
+      "script": "./jenkins-image-arvados-formula-tests.sh"
+    }
+  ]
+}
diff --git a/jenkins/packer-images/jenkins-image-arvados-formula-tests.sh b/jenkins/packer-images/jenkins-image-arvados-formula-tests.sh
new file mode 100755 (executable)
index 0000000..1057d0f
--- /dev/null
@@ -0,0 +1,18 @@
+#!/bin/bash
+
+# Copyright (C) The Arvados Authors. All rights reserved.
+#
+# SPDX-License-Identifier: Apache-2.0
+
+set -eo pipefail
+
+# Install the dependencies for the package building/testing jobs
+sudo su -c "DEBIAN_FRONTEND=noninteractive apt-get install -y docker.io git ruby ruby-dev make gcc g++"
+sudo usermod -a -G docker jenkins
+
+cd /tmp
+wget -c https://git.arvados.org/arvados-formula.git/blob_plain/refs/heads/main:/Gemfile
+wget -c https://git.arvados.org/arvados-formula.git/blob_plain/refs/heads/main:/Gemfile.lock
+sudo su -c "gem install bundler"
+sudo su -c "bundler install"
+sudo su -c "gem install kitchen-docker"