Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pull Request for issue #11 #12

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions WORKFLOW.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,24 +25,26 @@ Make some changes and push them live, but don't restart services:

cd src/myapp
git commit ...
ssh -i ~/.ssh/myapp.pem [email protected]:/var/myapp/update
git push origin master
ssh -i ~/.ssh/myapp.pem [email protected] '/var/myapp/update'
# some status output here

Make some changes and push them live, also restarting services (Node.js server):

cd src/myapp
git commit ...
ssh -i ~/.ssh/myapp.pem [email protected]:/var/myapp/update restart
git push origin master
ssh -i ~/.ssh/myapp.pem ubuntu@myapp '/var/myapp/update restart'

Revert to an older version on the server:

ssh -i ~/.ssh/myapp.pem [email protected]:/var/myapp/update restart v0.1.2
ssh -i ~/.ssh/myapp.pem [email protected] '/var/myapp/update restart v0.1.2'

> Note: `v0.1.2` in this example is a tag but can be replaced by any git refspec, like a commit hash or branch name.

You can simplify the "update" call by creating an alias in your `~/.bash_rc` (or other shell startup file):

alias myapp-update='ssh -i ~/.ssh/myapp.pem [email protected]:/var/myapp/update'
alias myapp-update="ssh -i ~/.ssh/myapp.pem [email protected] '/var/myapp/update'"

Then, the above example could instead be executed as:

Expand Down