2015-09-23 20:03:57 +00:00
|
|
|
{
|
|
|
|
"variables": {
|
|
|
|
"bin_url": "{{ env `NOMAD_URL` }}"
|
|
|
|
},
|
|
|
|
"builders": [
|
|
|
|
{
|
|
|
|
"type": "digitalocean",
|
|
|
|
"image": "ubuntu-12-04-x64",
|
|
|
|
"region": "nyc3",
|
2015-09-23 20:48:45 +00:00
|
|
|
"size": "512mb",
|
2015-09-24 19:15:34 +00:00
|
|
|
"snapshot_name": "nomad-demo-{{timestamp}}"
|
2015-09-23 20:03:57 +00:00
|
|
|
}
|
|
|
|
],
|
|
|
|
"provisioners": [
|
|
|
|
{
|
|
|
|
"type": "shell",
|
|
|
|
"inline": [
|
2015-09-26 17:30:08 +00:00
|
|
|
"apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D",
|
|
|
|
"echo 'deb https://apt.dockerproject.org/repo ubuntu-precise main' > /etc/apt/sources.list.d/docker.list",
|
2015-09-23 20:03:57 +00:00
|
|
|
"sudo apt-get -y update",
|
2015-12-09 03:52:58 +00:00
|
|
|
"sudo apt-get -y install unzip docker-engine curl",
|
2015-09-24 02:49:02 +00:00
|
|
|
"curl -o /tmp/nomad.zip -L {{ user `bin_url` }}",
|
2015-09-24 00:55:31 +00:00
|
|
|
"sudo unzip -d /usr/local/bin /tmp/nomad.zip",
|
2015-09-26 17:30:08 +00:00
|
|
|
"mkdir -p /usr/local/etc/nomad"
|
2015-09-23 20:03:57 +00:00
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "file",
|
|
|
|
"source": "upstart.nomad",
|
2015-09-23 23:52:38 +00:00
|
|
|
"destination": "/etc/init/nomad.conf"
|
2015-09-23 20:07:17 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "file",
|
|
|
|
"source": "default.hcl",
|
2015-09-23 20:48:45 +00:00
|
|
|
"destination": "/usr/local/etc/nomad/nomad.hcl"
|
2015-09-23 20:03:57 +00:00
|
|
|
}
|
2015-09-24 17:11:46 +00:00
|
|
|
],
|
|
|
|
"post-processors": [
|
|
|
|
{
|
|
|
|
"type": "atlas",
|
|
|
|
"artifact": "hashicorp/nomad-demo",
|
2015-09-24 17:51:23 +00:00
|
|
|
"artifact_type": "digitalocean.image"
|
2015-09-24 17:11:46 +00:00
|
|
|
}
|
|
|
|
],
|
|
|
|
"push": {
|
|
|
|
"name": "hashicorp/nomad-demo",
|
|
|
|
"vcs": true
|
|
|
|
}
|
2015-09-23 20:03:57 +00:00
|
|
|
}
|