Skip to content

Commit 65d097c

Browse files
committed
Adding logs to deploy-script
1 parent 14f500d commit 65d097c

1 file changed

Lines changed: 22 additions & 9 deletions

File tree

utils/deploy.sh

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ function get_tmp {
55
echo ".`cat /dev/urandom | env LC_CTYPE=C tr -dc a-z0-9 | head -c 16`"
66
}
77

8+
echo "Running deploy..."
9+
810
SRC_URL='git@github.com:frontendu/frontendu.github.io'
911
NPM_VERSION=$1
1012
TMP_PATH=`get_tmp`
@@ -14,28 +16,39 @@ if [ -z $NPM_VERSION ]; then
1416
NPM_VERSION='patch'
1517
fi
1618

19+
echo "Incrementing version to ${NPM_VERSION}..."
20+
1721
npm version $NPM_VERSION -m "Version bumped to %s"
1822

19-
git push origin dev
20-
git push --tags
23+
echo "Pushing version and tags..."
24+
25+
git push origin dev -q
26+
git push --tags -q
2127

2228
SITE_VERSION=`node -e "
2329
console.log(require('./package.json').version)
2430
"`
2531

26-
npm run build:prod
32+
echo "Builing site..."
2733

28-
git clone $SRC_URL $TMP_PATH
29-
cd $TMP_PATH;
30-
git checkout master
34+
npm run build:prod -- --silent
3135

32-
git rm -r ./
36+
echo "Prepare for publishing site..."
37+
38+
git clone $SRC_URL $TMP_PATH -q
39+
cd $TMP_PATH > /dev/null;
40+
git checkout master -q
41+
git rm -r ./ -q
42+
43+
echo "Copying new content of site..."
3344

3445
cp -r ../$DIST_PATH/* ./
35-
git add -A
46+
git add -A -q
47+
48+
echo "Publishing site..."
3649

3750
git commit -m "Version of site bumped to ${SITE_VERSION}" || rm -rf $TMP_PATH
3851

39-
git push origin master
52+
git push origin master -q
4053

4154
rm -rf $TMP_PATH

0 commit comments

Comments
 (0)