Bump the buster base image for our test image.
[arvados-dev.git] / jenkins / packer-images / jenkins-image-arvados-tests.sh
1 #!/bin/bash
2
3 # Copyright (C) The Arvados Authors. All rights reserved.
4 #
5 # SPDX-License-Identifier: Apache-2.0
6
7 set -eo pipefail
8
9 # Install the dependencies for arvados-server
10 sudo su -c "DEBIAN_FRONTEND=noninteractive apt-get install -y libpam0g-dev wget build-essential"
11
12 # Install the dependencies for the package building/testing jobs
13 sudo su -c "DEBIAN_FRONTEND=noninteractive apt-get install -y docker.io make wget dpkg-dev createrepo unzip"
14 sudo usermod -a -G docker jenkins
15
16 # Check out a local copy of the arvados repo so we can use it to install the dependencies
17 cd /usr/src
18 sudo git clone arvados.git
19
20 # Install the correct version of Go
21 GO_VERSION=`grep 'const goversion =' /usr/src/arvados/lib/install/deps.go |awk -F'"' '{print $2}'`
22 cd /usr/src
23 sudo wget https://golang.org/dl/go${GO_VERSION}.linux-amd64.tar.gz
24 sudo tar xzf go${GO_VERSION}.linux-amd64.tar.gz
25 sudo ln -s /usr/src/go/bin/go /usr/local/bin/go-${GO_VERSION}
26 sudo ln -s /usr/src/go/bin/gofmt /usr/local/bin/gofmt-${GO_VERSION}
27 sudo ln -s /usr/local/bin/go-${GO_VERSION} /usr/local/bin/go
28 sudo ln -s /usr/local/bin/gofmt-${GO_VERSION} /usr/local/bin/gofmt
29
30 # Preseed our dependencies
31 cd arvados
32 sudo go mod download
33 sudo go run ./cmd/arvados-server install -type test
34
35 # Our Jenkins jobs use this directory to store the temporary files for the tests
36 mkdir /home/jenkins/tmp
37
38 # Preseed the run-tests.sh cache. This is a little bit silly (a lot of this
39 # stuff was already done by the call to `./cmd/arvados-server install -type
40 # test` above, but they do not share a cache.
41 sudo chown jenkins:jenkins /home/jenkins -R
42 sudo chown jenkins:jenkins /usr/src/arvados -R
43 sudo -u jenkins ./build/run-tests.sh WORKSPACE=/usr/src/arvados --temp /home/jenkins/tmp --only install
44
45 # Install the arvados-dev repo where the jenkins `test-provision-multinode` job
46 # expects it
47 cd /usr/local
48 sudo git clone --depth 1 https://github.com/arvados/arvados-dev
49 sudo chown -R jenkins:jenkins /usr/local/arvados-dev/