Alister West

home is where your code is ...

Git Deploy

There are a bunch of ways to deploy a git app.

Deploy on Live with Merge

Although its not ideal to merge/commit on live we have a web cms system that updates some templates. So given that merging on live is necessary ...

echo "Are you on LIVE?"         # check your on your production server.
git branch                      # check where you are 
git status                      # see if anything has changed on master
git checkout master             # should already be here
git commit -a                   # commit all non-committed changes
git branch -D live-backup       # remove old backup
git branch live-backup          # create new backup
git fetch                       # fetches origin/master
git log origin/master ^master   # show commits from repo not in master

git rebase origin               # merge with linear history
bin/minify css,js               # minify css and js
sudo mpr $DOMAIN                # restart apache-server for $DOMAIN

git push origin                 # push production changes back to central repo
By Alister West