forked from compiler-explorer/infra
-
Notifications
You must be signed in to change notification settings - Fork 0
/
packer-local.json
51 lines (51 loc) · 1.43 KB
/
packer-local.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
{
"builders": [
{
"type": "docker",
"image": "ubuntu:20.04",
"commit": true
}
],
"variables": {
"MY_ACCESS_KEY": "",
"MY_SECRET_KEY": ""
},
"provisioners": [
{
"type": "shell",
"inline": [
"useradd ubuntu",
"usermod -aG sudo ubuntu",
"mkdir -p /home/ubuntu/.ssh",
"chown -R ubuntu /home/ubuntu",
"mkdir -p /root/.aws",
"echo '[default]' > /root/.aws/config",
"echo 'region=us-east-1' >> /root/.aws/config",
"echo '[default]' > /root/.aws/credentials",
"echo 'aws_access_key_id = {{user `MY_ACCESS_KEY`}}' >> /root/.aws/credentials",
"echo 'aws_secret_access_key = {{user `MY_SECRET_KEY`}}' >> /root/.aws/credentials",
"echo '# /opt here just to trick out the later scripts' >> /etc/fstab",
"mkdir -p /opt/compiler-explorer"
]
},
{
"type": "file",
"source": ".",
"destination": "/infra/"
},
{
"type": "shell",
"inline": [
"set -e",
"export DEBIAN_FRONTEND=noninteractive",
"mkdir -p /root/.ssh",
"cp /infra/packer/known_hosts /root/.ssh/",
"cp /infra/packer/known_hosts /home/ubuntu/.ssh/",
"apt-get -y update",
"apt-get -y install git sudo curl rsyslog psmisc systemd",
"cd /infra",
"env PACKER_SETUP=yes bash setup.sh --updated main 2>&1 | tee /tmp/setup.log"
]
}
]
}