Skip to content

Instantly share code, notes, and snippets.

@lxfontes
Created August 18, 2015 14:50
Show Gist options
  • Select an option

  • Save lxfontes/aae63d6a9f6bbac767bf to your computer and use it in GitHub Desktop.

Select an option

Save lxfontes/aae63d6a9f6bbac767bf to your computer and use it in GitHub Desktop.
sup.yml
env:
NAME: projectA
networks:
local:
env:
BRANCH: devel
hosts:
builder:
- localhost
webservers:
- localhost
databases:
- localhost
production:
env:
CONFIG: something_else
hosts_helper: ./fetch_production_hosts
commands:
repo_sync:
desc: update source
run: git fetch; git checkout $BRANCH
hosts:
- builder
build_image:
desc: build docker image
run: docker build -f Dockerfile
hosts:
- builder
upload_image:
desc: upload docker image
run: docker push some_image
hosts:
- builder
ping:
desc: print uname
run: uname -a; date
web_logs:
desc: tail webserver logs
run: echo running on webservers only
hosts:
- webservers
db_logs:
desc: tail db logs
run: echo running on dbs only
hosts:
- databases
tasks:
build:
- repo_sync
- build_image
- upload_image
deploy:
- build
- download_latest_image
- db_migrate
- restart_web
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment