Created
May 2, 2015 14:07
-
-
Save lhahne/0721c750fd49bfb1bfaf to your computer and use it in GitHub Desktop.
ansible git node deploy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- 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