Skip to content

Commit

Permalink
more if for build
Browse files Browse the repository at this point in the history
  • Loading branch information
licong08 committed Oct 26, 2017
1 parent 74692c5 commit 50de950
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
13 changes: 10 additions & 3 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,15 @@ mv ${BIN_DIR}/curve/static/v1 ${BIN_DIR}/curve/web/
sed -i -e "s%/static/v1/swagger.json%/web/v1/swagger.json%g" ${BIN_DIR}/curve/web/swagger-ui/index.html
rm -rf ${BIN_DIR}/curve/static
pip install -r ${BIN_DIR}/requirements.txt
pip install uwsgi

# package
echo "build done, usage:"
echo "1. cd ${BIN_DIR} && python -m curve"
echo "2. pip install uWSGI && cd ${BIN_DIR} && uwsgi uwsgi.ini"
if [ $? -ne 0 ]; then
echo "========================================"
echo "build uwsgi error, direct usage:"
echo "cd ${BIN_DIR} && python -m curve"
else
echo "========================================"
echo "build done, usage:"
echo "./control.sh start"
fi
4 changes: 2 additions & 2 deletions control.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ readonly G_SOURCEROOT="${G_HOME}/pysrc"

# TODO: check if built before

source ${G_VENV}

help() {
echo "${0} <start|stop|reload|terminate>"
exit 1
Expand All @@ -17,6 +15,7 @@ help() {
# TODO: check before operation

start() {
[ -e "${G_SOURCEROOT}/curve/web" ] || build.sh
cd ${G_SOURCEROOT}
mkdir -p ${G_SOURCEROOT}/log
source ${G_VENV}
Expand All @@ -30,6 +29,7 @@ stop() {
}

reload() {
[ -e "${G_SOURCEROOT}/curve/web" ] || build.sh
cd ${G_SOURCEROOT}
source ${G_VENV}
uwsgi --reload uwsgi.pid
Expand Down

0 comments on commit 50de950

Please sign in to comment.