#!/usr/bin/env bash set -euo pipefail : ${ADMIN_PASSWORD} : ${AWS_REGION} : ${S3_BUCKET} : ${SUPERVISOR_ACCESS_TOKEN} latest_release() { curl -sSL "https://api.github.com/repos/$1/releases/latest" | jq -r .tag_name } # I think there is a race condition related to Ubuntu wanting to do an # automated system upgrade at boot, which causes 'apt-get update' to # sometimes fail with an obscure error message. sleep 5 mkdir /tmp/riju-work pushd /tmp/riju-work export DEBIAN_FRONTEND=noninteractive sudo -E apt-get update sudo -E apt-get dist-upgrade -y sudo -E apt-get install -y curl gnupg lsb-release curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo -E apt-key add - ubuntu_name="$(lsb_release -cs)" sudo tee -a /etc/apt/sources.list.d/custom.list >/dev/null <