Merge branch '21521-aptly-flock'
[arvados-dev.git] / jenkins / packer-images / jenkins-image-with-docker.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 the package building/testing jobs
10 sudo su -c "DEBIAN_FRONTEND=noninteractive apt-get install -y docker.io make wget dpkg-dev createrepo-c unzip"
11 sudo usermod -a -G docker jenkins
12
13 # Packer install
14 cd /tmp
15 wget https://releases.hashicorp.com/packer/1.8.0/packer_1.8.0_linux_amd64.zip
16 unzip packer_1.8.0_linux_amd64.zip packer
17 sudo mv packer /usr/local/bin/
18
19 # Install the arvados-dev repo where the Jenkins job expects it
20 cd /usr/local
21 sudo git clone --depth 1 https://github.com/arvados/arvados-dev
22 sudo chown -R jenkins:jenkins /usr/local/arvados-dev/
23
24 # React uses a lot of filesystem watchers (via inotify). Increase the default
25 # so we have a higher limit at runtime.
26 echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf
27 sudo sysctl -p