From bee48b3434f26faa7a866ae3918c6ea731c51fbe Mon Sep 17 00:00:00 2001 From: Richard Soderberg <rsoderberg@gmail.com> Date: Mon, 2 Apr 2012 01:48:28 -0700 Subject: [PATCH] match indenting of hook script to rest of <pre> blocks --- docs/DEPLOYMENT.md | 68 +++++++++++++++++++++++----------------------- 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/docs/DEPLOYMENT.md b/docs/DEPLOYMENT.md index 76e01e383..74282a161 100644 --- a/docs/DEPLOYMENT.md +++ b/docs/DEPLOYMENT.md @@ -129,40 +129,40 @@ Now, here's a full sample script that you can start with for that post-update hook, annotated to help you follow along: <pre> - #!/bin/bash - - # only run these commands if it's the browserid repo bein' pushed - if [ "x$GL_REPO" == 'xbrowserid' ] ; then - # create a temporary directory where we'll stage new code - NEWCODE=`mktemp -d` - echo "staging code to $NEWCODE" - mkdir -p $NEWCODE - git archive --format=tar dev | tar -x -C $NEWCODE - - echo "generating production resources" - cd $NEWCODE/browserid && ./compress.sh && cd - - - # stop the servers - curl -o --url http://localhost:62700/code_update > /dev/null 2>&1 - curl -o --url http://localhost:62800/code_update > /dev/null 2>&1 - - # now move code into place, and keep a backup of the last code - # that was in production in .old - echo "moving updated code into place" - rm -rf /home/browserid/code.old - mv /home/browserid/code{,.old} - mv $NEWCODE /home/browserid/code - - echo "fixing permissions" - find /home/browserid/code -exec chgrp www-data {} \; > /dev/null 2>&1 - find /home/browserid/code -type d -exec chmod 0775 {} \; > /dev/null 2>&1 - find /home/browserid/code -type f -exec chmod ga+r {} \; > /dev/null 2>&1 - find /home/browserid/code -type f -perm /u+x -exec chmod g+x {} \; > /dev/null 2>&1 - - echo "updating dependencies" - ln -s /home/browserid/node_modules /home/browserid/code/node_modules - cd /home/browserid/code && npm install && cd - - fi +#!/bin/bash + +# only run these commands if it's the browserid repo bein' pushed +if [ "x$GL_REPO" == 'xbrowserid' ] ; then + # create a temporary directory where we'll stage new code + NEWCODE=`mktemp -d` + echo "staging code to $NEWCODE" + mkdir -p $NEWCODE + git archive --format=tar dev | tar -x -C $NEWCODE + + echo "generating production resources" + cd $NEWCODE/browserid && ./compress.sh && cd - + + # stop the servers + curl -o --url http://localhost:62700/code_update > /dev/null 2>&1 + curl -o --url http://localhost:62800/code_update > /dev/null 2>&1 + + # now move code into place, and keep a backup of the last code + # that was in production in .old + echo "moving updated code into place" + rm -rf /home/browserid/code.old + mv /home/browserid/code{,.old} + mv $NEWCODE /home/browserid/code + + echo "fixing permissions" + find /home/browserid/code -exec chgrp www-data {} \; > /dev/null 2>&1 + find /home/browserid/code -type d -exec chmod 0775 {} \; > /dev/null 2>&1 + find /home/browserid/code -type f -exec chmod ga+r {} \; > /dev/null 2>&1 + find /home/browserid/code -type f -perm /u+x -exec chmod g+x {} \; > /dev/null 2>&1 + + echo "updating dependencies" + ln -s /home/browserid/node_modules /home/browserid/code/node_modules + cd /home/browserid/code && npm install && cd - +fi </pre> ### 6. Get node servers running -- GitLab