forked from compiler-explorer/infra
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpacker-smb-local.json
54 lines (52 loc) · 1.6 KB
/
packer-smb-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
52
53
54
{
"builders": [
{
"type": "docker",
"image": "ubuntu:20.04",
"commit": true
}
],
"variables": {
"BRANCH": "main",
"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",
"cat /root/.aws/credentials",
"mkdir -p /opt/compiler-explorer"
]
},
{ "type": "file", "source": ".", "destination": "/home/ubuntu/" },
{
"type": "shell",
"inline": [
"set -e",
"export DEBIAN_FRONTEND=noninteractive",
"mkdir -p /root/.ssh",
"export LOCALPACK=1",
"cp /home/ubuntu/packer/known_hosts /root/.ssh/",
"cp /home/ubuntu/packer/known_hosts /home/ubuntu/.ssh/",
"rm -rf /home/ubuntu/packer",
"apt-get -y update",
"apt-get -y install git",
"git clone -b {{user `BRANCH`}} https://github.com/compiler-explorer/infra.git /infra",
"cd /infra",
"env PACKER_SETUP=yes bash setup-smb.sh 2>&1 | tee /tmp/setup.log"
]
}
]
}