Skip to content

Commit 5c19469

Browse files
committed
dist add bootstrap command
1 parent 4b71662 commit 5c19469

File tree

2 files changed

+48
-63
lines changed

2 files changed

+48
-63
lines changed

README.md

Lines changed: 34 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ PPMessage targets to be deployed on Linux, Mac OS X and Windows systems. And PPM
55

66
PPMessage includes a backend system which exposes oauth and web service APIs, a frontend SDK named PPCom, a frontend App named PPKefu.
77

8-
PPCom run in customer user side, and can be integrated in Web site via a single line Javascript code or integrated in mobile App with PPCom mobile API. Customer use PPCom to communicate with service user.
8+
PPCom run on customer user side, and can be integrated in Web site via a single line Javascript code or integrated in mobile App with PPCom mobile API. Customer use PPCom to communicate with service user.
99

10-
PPKefu run in service user side, service user can use PPKefu application to communicate with customer user. PPKefu can run on Windows, Mac OS X, Android, iOS and Web.
10+
PPKefu run on service user side, service user can use PPKefu application to communicate with customer user. PPKefu can run on Windows, Mac OS X, Android, iOS and Web.
1111

12-
PPConsole is Web user interface of PPMessage and open sourced. After PPMessage backend running, PPConsole provided a Web interface to help the service team leader to setup the PPMessage system.
12+
PPConsole is Web user interface of PPMessage and open sourced as well. After PPMessage backend running, PPConsole provided a Web interface to help the service team leader to setup the PPMessage system.
1313

1414

1515
> In the following, it is a simple guide to help developer delopy PPMessage backend and generate Web version of PPCom and PPKefu on Mac OS X. Want to know more, please go to [PPMessage Site](http://ppmessage.com) get more detail documents about PPMessage.
@@ -74,7 +74,7 @@ PPConsole is Web user interface of PPMessage and open sourced. After PPMessage b
7474

7575
### Config mysql and redis
7676

77-
* Mysql user and password (replace DB_PASSWORD with what you want to set as db password)
77+
* Mysql user and password (replace DB_PASSWORD with what you want to set as mysql password)
7878

7979
```Bash
8080
brew services list
@@ -89,62 +89,57 @@ PPConsole is Web user interface of PPMessage and open sourced. After PPMessage b
8989
brew services list
9090
brew services start redis
9191
```
92-
* Config redis
93-
```Bash
94-
vim /usr/local/etc/redis.conf and comment all save lines
95-
> # save 900 1
96-
> # save 300 10
97-
> # save 60 10000
98-
```
9992

10093
### Config and prepare PPMessage
10194

10295
> Assuming you have clone ppmessage and under ppmessage directory.
10396
> In the directory, you can see `dist.sh` `README.md` files and `ppmessage` directory.
10497
105-
Before config PPMessage check the requirement is done or not.
98+
#### Check the requirement is done or not.
99+
100+
> require.py needs super user permission
106101
107102
```Bash
108-
python ppmessage/scripts/require.py
103+
sudo python ppmessage/scripts/require.py
109104
```
110105

106+
#### Use your text editor (vim/emacs/sublime) to edit the config file in PPMessage
107+
111108
```Bash
112109
vim ppmessage/bootstrap/config.py
113-
...
114-
python ppmessage/scripts/table.py
115-
python ppmessage/scripts/bootstrap.py
116-
python ppmessage/scripts/db2cache.py
117110
```
118111

119-
### Generate PPCom - web version
112+
#### Bootstrap PPMessage based on your customized config.py file
113+
```Bash
114+
sh dist.sh bootstrap
115+
```
116+
117+
### Generate PPCom/PPKefu/PPConsole - web version
118+
119+
> PPCom has iOS and Android SDK. PPKefu has Android, iOS, Windows PC, Mac OS X PC application.
120+
121+
#### Bower components install
122+
123+
> Install Web javascript libraries via bower.
120124
121125
```Bash
122-
cd ppmessage/ppcom/web
123-
bower install
124-
cd -
125-
cd ppmessage/ppcom/web/gulp
126-
npm install
127-
gulp
126+
sh dist.sh bower
128127
```
129128

130-
### Generate PPKefu - web version
129+
#### Node components install
130+
131+
> Install node.js components via npm.
131132
132133
```Bash
133-
cd ppmessage/ppkefu/ppkefu
134-
bower install
135-
npm install
136-
gulp
134+
sh dist.sh npm
137135
```
138136

139-
### Generate PPConsole
137+
#### Run gulp task
138+
139+
> Use gulp task to generate final PPCom/PPKefu/PPConsole javascript file.
140140
141141
```Bash
142-
cd ppmessage/ppconsole
143-
bower install
144-
cd -
145-
cd ppmessage/ppconsole/gulp
146-
npm install
147-
gulp
142+
sh dist.sh gulp
148143
```
149144

150145
### Start/Stop PPMessage server
@@ -160,20 +155,18 @@ Before config PPMessage check the requirement is done or not.
160155
sh dist.sh log
161156
```
162157

163-
> Check PPMessage status
164-
> sh dist.sh proc
165-
166-
167158
### Check PPCOM
168159

169-
Use your brower open your server url which has been configed, suggest using Chrome browser.
160+
Use your browser open your server url which has been configed in config.py file.
170161

171162
> PPCONSOLE/PPCOM
163+
172164
```Bash
173165
http://server_name:nginx_listen_port
174166
```
175167

176168
> PPKEFU
169+
177170
```Bash
178171
http://server_name:nginx_listen_port/ppkefu
179172
```

dist.sh

Lines changed: 14 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,10 @@ Commands:
4646
stop Stop ppmessage service.
4747
restart Restart ppmessage service.
4848
log View the ppmessage logs.
49-
ppmessage Deploy ppmessage.
49+
bower Install bower components.
50+
npm Install node components.
51+
gulp Run all gulp tasks.
52+
bootstrap Bootstrap PPMessage with config.py.
5053
app-win32 Create window desktop app.
5154
app-win64 Create window desktop app.
5255
app-mac Create mac os x desktop app.
@@ -299,6 +302,14 @@ function ppmessage_npm()
299302
cd ppmessage/ppconsole/gulp; npm install; cd -;
300303
}
301304
305+
function ppmessage_bootstrap()
306+
{
307+
echo "bootstrap will create db tables and config the PPMessage";
308+
python ppmessage/scripts/table.py;
309+
python ppmessage/scripts/bootstrap.py;
310+
python ppmessage/scripts/db2cache.py;
311+
}
312+
302313
303314
### MAIN ###
304315
@@ -308,16 +319,9 @@ ppmessage_options $*
308319
ppmessage_check_path
309320
310321
case "$1" in
311-
init-ppmessage)
312-
ppmessage_init ppmessage
313-
;;
314-
315-
init-cache)
316-
ppmessage_init_cache
317-
;;
318322
319-
local-oauth)
320-
ppmessage_local_oauth
323+
bootstrap)
324+
ppmessage_bootstrap
321325
;;
322326
323327
dev)
@@ -407,18 +411,6 @@ case "$1" in
407411
app-scp)
408412
ppmessage_app_scp
409413
;;
410-
411-
app-auto-update)
412-
ppmessage_app_auto_update
413-
;;
414-
415-
app-scp-test)
416-
ppmessage_app_scp_test
417-
;;
418-
419-
app-auto-update-test)
420-
ppmessage_app_auto_update_test
421-
;;
422414
423415
*)
424416
ppmessage_help

0 commit comments

Comments
 (0)