forked from cocos2d/cocos2d-x-docs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
executable file
·187 lines (158 loc) · 5.55 KB
/
build.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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
#!/bin/sh
# This script builds: Cocos2d-x-docs, Cocos Creator Manual, Cocos Creator API-Ref.
# on production this script should be run as:
# (cd /data/home/docops/cocos2d-x-docs && exec /data/home/docops/cocos2d-x-docs/deploy_cron.sh)
echo "-----------------"
echo "Cocos2d-x-docs..."
echo "-----------------"
# First Cocos2d-x docs, we are aready in this repo when executing this script
## pull latest from github
echo "Cocos2d-x-docs -- pulling latest from GitHub..."
git pull origin master
cp -rf config/cocos2d-x.org/. ./
## make sure gitbook is up to date
echo "Cocos2d-x-docs -- ensuring GitBook is up to date..."
gitbook install
## build it
echo "Cocos2d-x-docs -- building GitBook docs...."
gitbook build
## copy some needed files
echo "Cocos2d-x-docs -- copying needed files..."
cp redirect.html.en _book/index.html
cp index.html.en ../documentation/index.html
## copy everything to deployment directory
echo "Cocos2d-x-docs -- copy everything to deployment directory..."
mv _book/ cocos2d-x/
rsync --recursive cocos2d-x ../documentation
rm -rf cocos2d-x/
git stash
echo "-----------------------"
echo "Cocos Creator Manual..."
echo "-----------------------"
## pull latest from github
echo "Cocos Creator -- building documentation..."
cd ../creator-docs
## pulling legacy version
echo "Cocos Creator -- pulling v1.9..."
git checkout v1.9
git pull origin v1.9
cp -rf config/cocos2d-x.org/. ./
echo "Cocos Creator -- building GitBook docs...."
echo "If this is your first time build this repo, please stop this process and run:"
echo "npm install gulp -g"
echo "npm install"
echo "DO NOT COMMIT: package-lock.json"
sudo npm install gulp -g
sudo npm install
echo "Cocos Creator -- ensuring GitBook is up to date..."
gitbook install
npm run build
echo "Cocos Creator -- copy everything to deployment directory..."
cp ../cocos2d-x-docs/redirect.html.en _book/index.html
mv _book/ manual/
rsync --recursive manual ../documentation/creator/1.9
rm -rf manual/
git stash
## pulling previous version
echo "Cocos Creator -- pulling v1.10..."
git checkout master
git pull origin master
cp -rf config/cocos2d-x.org/. ./
echo "Cocos Creator -- building GitBook docs...."
echo "If this is your first time build this repo, please stop this process and run:"
echo "npm install gulp -g"
echo "npm install"
echo "DO NOT COMMIT: package-lock.json"
sudo npm install gulp -g
sudo npm install
echo "Cocos Creator -- ensuring GitBook is up to date..."
gitbook install
npm run build
echo "Cocos Creator -- copy everything to deployment directory..."
cp ../cocos2d-x-docs/redirect.html.en _book/index.html
mv _book/ manual/
rsync --recursive manual ../documentation/creator/1.10
rm -rf manual/
git stash
## pulling next version
echo "Cocos Creator -- pulling v2.x.."
git checkout next
git pull origin next
cp -rf config/cocos2d-x.org/. ./
echo "Cocos Creator -- building GitBook docs...."
echo "If this is your first time build this repo, please stop this process and run:"
echo "npm install gulp -g"
echo "npm install"
echo "DO NOT COMMIT: package-lock.json"
sudo npm install gulp -g
sudo npm install
echo "Cocos Creator -- ensuring GitBook is up to date..."
gitbook install
npm run build
echo "Cocos Creator -- copy everything to deployment directory..."
cp ../cocos2d-x-docs/redirect.html.en _book/index.html
mv _book/ manual/
rsync --recursive manual ../documentation/creator
rm -rf manual/
git stash
echo "------------------------"
echo "Cocos Creator API-Ref..."
echo "------------------------"
## pull latest from github
echo "Cocos Creator API -- building documentation..."
cd ../creator-api-docs
echo "Cocos Creator API - pulling legacy version..."
git checkout v1.9
git pull origin v1.9
cp -rf config/cocos2d-x.org/. ./
echo "Cocos Creator API -- ensuring GitBook is up to date..."
gitbook install
echo "Cocos Creator API -- building GitBook docs...."
gitbook build
echo "Cocos Creator API -- copy everything to deployment directory..."
cp ../cocos2d-x-docs/redirect.html.en _book/index.html
mv _book/ v1.9/
rsync --recursive v1.9 ../documentation/api-ref/creator
mv v1.9/ api/
rsync --recursive api ../documentation/creator/1.9
#rm -rf ../documentation/api-ref/creator/v1.9/
#mv ../documentation/api-ref/creator/api/ ../documentation/api-ref/creator/v1.9/
rm -rf api/
git stash
echo "Cocos Creator API - pulling previous version..."
git checkout master
git pull origin master
cp -rf config/cocos2d-x.org/. ./
echo "Cocos Creator API -- ensuring GitBook is up to date..."
gitbook install
echo "Cocos Creator API -- building GitBook docs...."
gitbook build
echo "Cocos Creator API -- copy everything to deployment directory..."
cp ../cocos2d-x-docs/redirect.html.en _book/index.html
mv _book/ v1.10/
rsync --recursive v1.10 ../documentation/api-ref/creator
mv v1.10/ api/
rsync --recursive api ../documentation/creator/1.10
#rm -rf ../documentation/api-ref/creator/v1.9/
#mv ../documentation/api-ref/creator/api/ ../documentation/api-ref/creator/v1.9/
rm -rf api/
git stash
echo "Cocos Creator API - pulling current version..."
git checkout v2.0
git pull origin v2.0
cp -rf config/cocos2d-x.org/. ./
echo "Cocos Creator API -- ensuring GitBook is up to date..."
gitbook install
echo "Cocos Creator API -- building GitBook docs...."
gitbook build
echo "Cocos Creator API -- copy everything to deployment directory..."
cp ../cocos2d-x-docs/redirect.html.en _book/index.html
mv _book/ api/
rsync --recursive api ../documentation/creator/
mv api/ v2.0/
rsync --recursive v2.0 ../documentation/api-ref/creator
#rm -rf ../documentation/api-ref/creator/v1.9/
#mv ../documentation/api-ref/creator/api/ ../documentation/api-ref/creator/v1.9/
rm -rf v2.0/
git stash
cd ..