forked from ionic-team/ionic-framework
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeploy.sh
executable file
·79 lines (70 loc) · 1.95 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
#!/bin/bash
ARG_DEFS=(
"--sha1=(.*)"
"--index=(.*)"
"--build-number=(.*)"
)
function run {
cd ../..
# If --git-push-dryrun or --verbose is set on this script,
# export it to all the scripts
export GIT_PUSH_DRYRUN=$GIT_PUSH_DRYRUN
export VERBOSE=$VERBOSE
git config --global user.name 'Ionitron'
git config --global user.email [email protected]
git show $SHA1~1:package.json > .package.tmp.json
OLD_VERSION=$(readJsonProp ".package.tmp.json" "version")
VERSION=$(readJsonProp "package.json" "version")
if [[ "$OLD_VERSION" != "$VERSION" ]]; then
./scripts/bump/release.sh --new-version="$VERSION"
IS_RELEASE=true
VERSION_NAME=$(readJsonProp "package.json" "version")
else
./scripts/bump/nightly.sh --build-number=$BUILD_NUMBER
VERSION_NAME="nightly"
fi
case $INDEX in
0)
# Push release to ionic repo: release only
if [[ "$IS_RELEASE" == "true" ]]; then
./scripts/release/publish.sh
node_modules/.bin/gulp release-discourse
node_modules/.bin/gulp release-github
node_modules/.bin/gulp release-tweet
node_modules/.bin/gulp release-irc
fi
;;
1)
# Update app-base: release only
if [[ "$IS_RELEASE" == "true" ]]; then
./scripts/app-base/publish.sh
fi
;;
2)
# We have to install jekyll for the site task for now.
gem install jekyll
# Install gulp globally for site deploy script.
npm install -g gulp
# Be sure to update the site one after the other,
# so the tasks don't have a push conflict
if [[ "$IS_RELEASE" == "true" ]]; then
./scripts/site/config.sh
fi
# Update docs
./scripts/site/docs.sh --version-name="$VERSION_NAME"
;;
3)
# Update demos
./scripts/demo/publish.sh --version-name="$VERSION_NAME"
;;
4)
# Update cdn
./scripts/cdn/publish.sh --version-name="$VERSION_NAME"
;;
5)
# Update bower
./scripts/bower/publish.sh
;;
esac
}
source $(dirname $0)/../utils.inc