Build install scripts that are stand-alone bash
Support "dry runs", where the guard statements can be executed without actually running the installation statements
cd $DEPLOY | |
git rev-parse HEAD |
# deploy to: | |
SERVER=server.com | |
APP=app_name | |
DEPLOY=/srv/$APP | |
ENVIRONMENT=production | |
# clone source from: | |
REPO=ssh://[email protected]/username/repo.git | |
BRANCH=master |
Problem: how to reference templates from recipe file? | |
How about.... | |
* export all attributes as env variables (in install.sh just before the place where the role scripts get injected?) | |
* add helper method to recipes/sunzi.sh called sunzi::template | |
* call sunzi::template from recipes and pass in url of template file | |
* sunzi::template will wget the file to ~/sunzi/files/ unless the file already exists (allows override with local template file) | |
* sunzi::template will then run the template file through envsubst to substitute the env variables (http://www.oreillynet.com/linux/cmd/cmd.csp?path=e/envsubst) |
server { | |
listen 80; | |
server_name amaroadreports.ca www.amaroadreports.ca; | |
root /srv/road_reports_static; | |
location / { | |
try_files $uri/index.html $uri.html $uri @missing; | |
} | |
location @missing { |
gem 'dogstatsd-ruby' |
Stop serving assets from your own nginx instance. Instead, let Cloudfront CDN do it for you.
Steps:
curl -X POST -d 'payload={"id": 999999, "time": "2012-03-05T15:36:51Z", "server_name": "Blade", "server_hostname": "blade", "lifecycle": "start", "title": "Last minute met or exceeded 3.00 , increasing to 3.50 at 01:06AM", "plugin_name": "Load Average", "metric_name": "last_minute", "metric_value": 3.5, "severity": "warning", "url": "https://scoutapp.com/a/999999"}' http://HOSTNAME/hubot/scoutapp/ROOM_NUMBER |