blob: bf8605514a101bb53e9aa6184c30a189a2f0dc7d [file] [log] [blame]
{
"variables":{
"region":"us-west-2",
"source_ami":"ami-08718fb38f5f50f34",
"source_image_name":"X.vmx",
"image_name":"build-ubuntu"
},
"builders":[
{
"type":"amazon-ebs",
"instance_type":"t2.micro",
"ami_name":"native-{{user `version`}}-{{user `image_name`}} {{timestamp}}",
"access_key":"{{user `aws_access_key`}}",
"secret_key":"{{user `aws_secret_key`}}",
"region":"{{user `region`}}",
"source_ami":"{{user `source_ami`}}",
"subnet_id":"{{user `subnet_id`}}",
"vpc_id":"{{user `vpc_id`}}",
"tags":{
"team":"native",
"version":"{{user `version`}}",
"source_ami":"{{user `source_ami`}}"
},
"ssh_username":"ubuntu",
"ssh_pty":true
}
],
"provisioners":[
{
"type":"shell",
"script":"ubuntu/wait-for-cloud-init.sh"
},
{
"type":"shell",
"execute_command":"{{.Vars}} sudo -E -S bash '{{.Path}}'",
"pause_before":"30s",
"scripts":[
"ubuntu/update.sh"
]
},
{
"type":"file",
"source":"ubuntu/files",
"destination":"/tmp"
},
{
"type":"shell",
"execute_command":"{{.Vars}} sudo -E -S bash '{{.Path}}'",
"inline":[
"cp -rv /tmp/files/* /",
"rm -rf /tmp/files",
"chmod +x /etc/init-user.sh",
"chmod +x /usr/local/bin/update-hosts.sh",
"systemctl daemon-reload",
"systemctl enable update-hosts.service",
"systemctl start update-hosts.service"
]
},
{
"type":"shell",
"execute_command":"{{.Vars}} sudo -E -S bash '{{.Path}}'",
"scripts":[
"ubuntu/add-user-build.sh",
"ubuntu/install-packages.sh",
"ubuntu/install-coverage-tools.sh",
"ubuntu/install-cmake.sh",
"ubuntu/install-clang-format.sh"
]
},
{
"type":"file",
"source":"{{user `gemfire_archive`}}",
"destination":"gemfire.tar.gz"
},
{
"type":"shell",
"execute_command":"{{.Vars}} sudo -E -S bash '{{.Path}}'",
"scripts":[
"ubuntu/install-gemfire.sh"
]
},
{
"type":"shell",
"execute_command":"{{.Vars}} sudo -E -S bash '{{.Path}}'",
"scripts":[
"ubuntu/cleanup.sh"
]
}
]
}