Skip to content

Commit

Permalink
configuration template support (from pull request #75)
Browse files Browse the repository at this point in the history
防止本地化的配置加入到项目中
  • Loading branch information
sumory committed Mar 10, 2017
2 parents 6fada82 + 5413c94 commit 7d35ecb
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,8 @@ nbproject
Thumbs.db


/conf/nginx.conf
/conf/orange.conf
*.bt
*.svg
*.cbt
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,22 @@ ORANGE_HOME ?= /usr/local/orange
ORANGE_BIN ?= /usr/local/bin/orange

.PHONY: test install show
init-config:
@ test -f conf/nginx.conf || (cp conf/nginx.conf.example conf/nginx.conf && echo "copy nginx.conf")
@ test -f conf/orange.conf || (cp conf/orange.conf.example conf/orange.conf && echo "copy orange.conf")

test:
@echo "to be continued..."

install:
install:init-config
@rm -rf $(ORANGE_BIN)
@rm -rf $(ORANGE_HOME)
@mkdir -p $(ORANGE_HOME)

@for item in $(TO_INSTALL) ; do \
cp -a $$item $(ORANGE_HOME)/; \
done;

@cat $(ORANGE_HOME)/conf/nginx.conf | sed "s/..\/\?.lua;\/usr\/local\/lor\/\?.lua;;/\/usr\/local\/orange\/\?.lua;\/usr\/local\/lor\/?.lua;;/" > $(ORANGE_HOME)/conf/new_nginx.conf
@rm $(ORANGE_HOME)/conf/nginx.conf
@mv $(ORANGE_HOME)/conf/new_nginx.conf $(ORANGE_HOME)/conf/nginx.conf
Expand Down
File renamed without changes.
File renamed without changes.
7 changes: 6 additions & 1 deletion start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ then
pid=`cat $current_path/logs/nginx.pid`
fi

if [ ! -f ./conf/nginx.conf ] || [ ! -f ./conf/orange.conf ]
then
make init-config
fi

if [ "$pid" = "" ]
then
echo "start orange.."
Expand All @@ -19,4 +24,4 @@ else
fi

mkdir -p logs
nginx -p `pwd` -c ./conf/nginx.conf
nginx -p `pwd` -c ./conf/nginx.conf

0 comments on commit 7d35ecb

Please sign in to comment.