Skip to content

Instantly share code, notes, and snippets.

@lhahne
Created May 2, 2015 14:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lhahne/0721c750fd49bfb1bfaf to your computer and use it in GitHub Desktop.
Save lhahne/0721c750fd49bfb1bfaf to your computer and use it in GitHub Desktop.
ansible git node deploy
- user: name=deploy state=present
- file: path=/opt/my_app state=directory owner=deploy mode=0755
- copy: src=deploy_key dest=~deploy/.ssh/deploy_key mode=0600 owner=deploy
- git: repo="git@bitbucket.org:lhahne/my_app.git" dest="/opt/my_app" version=master accept_hostkey=True key_file=~deploy/.ssh/deploy_key
- shell: npm install && NODE_ENV=production npm run build
sudo_user: deploy
args:
chdir: /opt/my_app
- copy: src=upstart dest=/etc/init/my_app.conf mode=0644
- service: name=my_app state=restarted enabled=yes
- service: name=nginx state=restarted enabled=yes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment