-
Notifications
You must be signed in to change notification settings - Fork 0
/
packer-worker.json
58 lines (57 loc) · 1.66 KB
/
packer-worker.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
55
56
57
{
"variables": {
"ami_name": "15411_worker_{{isotime \"2006-01-02_15-04-05\"}}.img",
"aws_access_key": "{{env `AWS_ACCESS_KEY`}}",
"aws_secret_key": "{{env `AWS_SECRET_KEY`}}",
"docker_username": "{{env `DOCKER_USERNAME`}}",
"docker_password": "{{env `DOCKER_PASSWORD`}}",
"github_key_source": "cmu-15-411-bot-key",
"github_key_destination": "/home/ubuntu/github_key.pem"
},
"builders": [{
"type": "amazon-ebs",
"access_key": "{{user `aws_access_key`}}",
"secret_key": "{{user `aws_secret_key`}}",
"region": "us-east-1",
"source_ami_filter": {
"filters": {
"virtualization-type": "hvm",
"name": "ubuntu/images/*/ubuntu-focal-20.04-amd64-server-*",
"root-device-type": "ebs"
},
"owners": ["099720109477"],
"most_recent": true
},
"instance_type": "t2.large",
"ssh_username": "ubuntu",
"ami_description": "AMI automatically built from worker-aws repository.",
"ami_name": "{{user `ami_name`}}",
"tags": {
"Name": "{{user `ami_name`}}"
},
"launch_block_device_mappings": [
{
"device_name": "/dev/sda1",
"volume_size": 20,
"volume_type": "gp2",
"delete_on_termination": true
}
]
}],
"provisioners": [
{
"type": "file",
"source": "{{user `github_key_source`}}",
"destination": "{{user `github_key_destination`}}"
},
{
"type": "shell",
"script": "./setup.sh",
"environment_vars": [
"GITHUB_PEM={{user `github_key_destination`}}",
"DOCKER_USERNAME={{user `docker_username`}}",
"DOCKER_PASSWORD={{user `docker_password`}}"
]
}
]
}