forked from tangrams/generic-demo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
deploy
executable file
·28 lines (26 loc) · 811 Bytes
/
deploy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/sh
set -e -x
git --version
upstream=$1
: ${upstream:=blnalt}
: ${REPO:[email protected]:almereyda/alternatives.berlin}
git fetch $upstream
if [ `git rev-list HEAD...$upstream/master --count` -ne 0 ]; then
echo "not deploying"
exit 1
fi
npm start --version && [ -d "./node_modules/tangram" ] || npm i
rm -rf _public
# use --reference when not in shallow clone
# git clone $REPO --reference . -b dokku _public
git clone $REPO -b deployment _public
rm -rf _public/*
REV=`git describe --always`
BUILD=git-$REV ./node_modules/.bin/gulp build
cd _public
git remote add deploy [email protected]:alternatives-berlin
git add -A .
echo "regen for $REV" | git commit-tree `git write-tree` -p `git rev-parse HEAD` -p $REV | xargs git reset --hard
git push origin
git push -f deploy deployment:master
cd ..