forked from gruntwork-io/terratest
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.json
53 lines (53 loc) · 1.46 KB
/
build.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
{
"variables": {
"aws_region": "us-east-1",
"ami_name_base": "terratest-packer-docker-example"
},
"builders": [{
"name": "ubuntu-ami",
"ami_name": "{{user `ami_name_base`}}-{{isotime | clean_ami_name}}",
"ami_description": "An example of how to create a custom AMI with a simple web app on top of Ubuntu",
"instance_type": "t2.micro",
"region": "{{user `aws_region`}}",
"type": "amazon-ebs",
"source_ami_filter": {
"filters": {
"virtualization-type": "hvm",
"architecture": "x86_64",
"name": "*ubuntu-xenial-16.04-amd64-server-*",
"block-device-mapping.volume-type": "gp2",
"root-device-type": "ebs"
},
"owners": ["099720109477"],
"most_recent": true
},
"ssh_username": "ubuntu",
"encrypt_boot": false
},{
"name": "ubuntu-docker",
"type": "docker",
"image": "gruntwork/ubuntu-test:16.04",
"commit": true
}],
"provisioners": [{
"type": "shell",
"inline": [
"echo 'Sleeping for a few seconds to give Ubuntu time to boot up'",
"sleep 30"
],
"only": ["ubuntu-ami"]
},{
"type": "file",
"source": "{{template_dir}}",
"destination": "/tmp/packer-docker-example"
},{
"type": "shell",
"inline": ["/tmp/packer-docker-example/configure-sinatra-app.sh"]
}],
"post-processors": [{
"type": "docker-tag",
"repository": "gruntwork/packer-docker-example",
"tag": "latest",
"only": ["ubuntu-docker"]
}]
}