demo/digitalocean: add statsite

This commit is contained in:
Ryan Uber 2015-09-24 12:03:28 -07:00
parent 727015d4d0
commit f6d35c94da
3 changed files with 62 additions and 0 deletions

View File

@ -0,0 +1,2 @@
[statsite]
stream_cmd = cat >> /opt/statsite.out

View File

@ -0,0 +1,50 @@
{
"variables": {
"bin_url": "{{ env `STATSITE_URL` }}"
},
"builders": [
{
"type": "digitalocean",
"image": "ubuntu-12-04-x64",
"region": "nyc3",
"size": "512mb",
"snapshot_name": "nomad-{{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/noad-demo-statsite",
"artifact_type": "digitalocean.image"
}
],
"push": {
"name": "hashicorp/nomad-demo-statsite",
"vcs": true
}
}

View File

@ -0,0 +1,10 @@
description "Statsite"
start on runlevel [2345]
stop on runlevel [!2345]
respawn
script
exec /usr/local/bin/statsite -f /usr/local/etc/statsite.conf >> /var/log/statsite.log 2>&1
end script