forked from gitana/alpaca
-
Notifications
You must be signed in to change notification settings - Fork 0
/
deploy.sh
108 lines (74 loc) · 1.63 KB
/
deploy.sh
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
VERSION="$(node server/version)"
BRANCH="$VERSION-release"
ZIP="alpaca-$VERSION.zip"
echo Deploying version $VERSION
#
# SETUP
#
# switch to master branch
# create a local branch <version>-release
git checkout master
git checkout -b $BRANCH
#
# STEP 1: BUILD ALPACA, WEB SITE JSDOCS AND DEPLOY TO CDN
#
# build alpaca
# build web site
# copy to dist (for bower)
gulp default site dist
# build jsdoc
grunt jsdoc
# add the ./dist directory to the commit
git add dist -f
# commit changes to local branch
git commit -m "alpaca release build $VERSION"
#
# STEP 2: PUBLISH DISTRIBUTION FILES TO CDN
#
# publish alpaca to CDN
grunt publish
#
# STEP 3: PUBLISH WEB SITE
#
rm build/$ZIP
cd build/web
zip -r ../$ZIP *
cd ../..
scp -i ~/keys/gitana.pem -r build/$ZIP [email protected]:/web/code/alpaca
CMD1="cd /web/code/alpaca; rm /web/code/alpaca/$VERSION; unzip -o /web/code/alpaca/$ZIP -d /web/code/alpaca/$VERSION"
echo $CMD1
ssh -i ~/keys/gitana.pem [email protected] $CMD1
CMD2="cd /web/code/alpaca; rm -r /web/code/alpaca/latest; unzip -o /web/code/alpaca/$ZIP -d /web/code/alpaca/latest"
echo $CMD2
ssh -i ~/keys/gitana.pem [email protected] $CMD2
#
# STEP 4: TAG REPO FOR BOWER
#
# create a tag
git tag $VERSION
# push the tag
#git push origin $BRANCH --tags
git push origin $VERSION
#
# STEP 5: NPM
# This copies essentials into a new directory.
#
rm -r npm
mkdir npm
cp README.md npm
cp bower.json npm
cp -r dist npm
cp license.txt npm
cp package.json npm
cp -r src npm
cp -r tests npm
cp -r thirdparty npm
cd npm
npm publish --force
cd ..
#
# TEARDOWN
#
# delete local branch
git checkout master
git branch -D $BRANCH