open-nomad/demo/digitalocean/packer/statsite/packer.json
2015-09-24 12:31:06 -07:00

51 lines
1.2 KiB
JSON

{
"variables": {
"bin_url": "{{ env `STATSITE_URL` }}"
},
"builders": [
{
"type": "digitalocean",
"image": "ubuntu-12-04-x64",
"region": "nyc3",
"size": "512mb",
"snapshot_name": "nomad-demo-statsite-{{timestamp}}"
}
],
"provisioners": [
{
"type": "shell",
"inline": [
"sudo apt-get -y update",
"sudo apt-get -y install unzip build-essential scons",
"curl -o /tmp/statsite.zip -L {{ user `bin_url` }}",
"mkdir -p /tmp/statsite",
"unzip -d /tmp/statsite /tmp/statsite.zip",
"cd /tmp/statsite/* && make",
"mv /tmp/statsite/*/statsite /usr/local/bin",
"rm -rf /tmp/statsite"
]
},
{
"type": "file",
"source": "upstart.statsite",
"destination": "/etc/init/statsite.conf"
},
{
"type": "file",
"source": "default.conf",
"destination": "/usr/local/etc/statsite.conf"
}
],
"post-processors": [
{
"type": "atlas",
"artifact": "hashicorp/nomad-demo-statsite",
"artifact_type": "digitalocean.image"
}
],
"push": {
"name": "hashicorp/nomad-demo-statsite",
"vcs": true
}
}