Skip to content

Commit

Permalink
Add install folder
Browse files Browse the repository at this point in the history
  • Loading branch information
outkine committed Jan 31, 2019
1 parent 5b136ad commit c1cf7bd
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions install/post-receive
@@ -0,0 +1,19 @@
#!/bin/bash
TARGET="/home/ubuntu/codingworkshops"
GIT_DIR="/home/ubuntu/codingworkshops.git"
BRANCH="master"

while read oldrev newrev ref
do
# only checking out the master (or whatever branch you would like to deploy)
if [[ $ref = refs/heads/$BRANCH ]];
then
echo "Ref $ref received. Deploying ${BRANCH} branch to production..."
git --work-tree=$TARGET --git-dir=$GIT_DIR checkout -f
cd $TARGET
npm i
npm run build
else
echo "Ref $ref received. Doing nothing: only the ${BRANCH} branch may be deployed on this server."
fi
done

0 comments on commit c1cf7bd

Please sign in to comment.