demo/digitalocean: add statsite
This commit is contained in:
parent
727015d4d0
commit
f6d35c94da
|
@ -0,0 +1,2 @@
|
|||
[statsite]
|
||||
stream_cmd = cat >> /opt/statsite.out
|
|
@ -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
|
||||
}
|
||||
}
|
|
@ -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
|
Loading…
Reference in New Issue