1
0
mirror of https://github.com/schollz/cowyo.git synced 2023-08-10 21:13:00 +03:00
cowyo/Makefile
Zack Scholl e819e6ede8 updated makefile with phony
Former-commit-id: ee957c8c68ea80b448f4ea1f5376c2ac00e11c89 [formerly 835753e21e00d030bd4601d494774506bf47323c] [formerly 6067af840fc24ec21306d335ff5194b5ed8028d8 [formerly a6395fc6aa178a2ba4843e9a0846bb98bc02d079 [formerly cf839c1eae]]]
Former-commit-id: 1cdb01969f8313a090c18b13dbab6816a081c127 [formerly e107909f78888acd0d4866370edccaeee9b0258b]
Former-commit-id: 55e900951726d017b52f4360a7b487c09e188617
Former-commit-id: 5a407dd408
2016-02-08 12:46:54 -05:00

33 lines
1000 B
Makefile

ADDRESS = cowyo.com
PORT = 8001
CUR_DIR = $(shell bash -c 'pwd')
USERCUR = $(shell bash -c 'whoami')
make:
go build
install:
rm -rf jinstall
mkdir jinstall
cp install/cowyo.nginx jinstall/cowyo.nginx
sed -i 's/PORT/$(PORT)/g' jinstall/cowyo.nginx
sed -i 's/ADDRESS/$(ADDRESS)/g' jinstall/cowyo.nginx
sed -i 's^CUR_DIR^$(CUR_DIR)^g' jinstall/cowyo.nginx
cp install/cowyo.init jinstall/cowyo.init
sed -i 's/EXT_ADDRESS/$(ADDRESS)/g' jinstall/cowyo.init
sed -i 's^CUR_DIR^$(CUR_DIR)^g' jinstall/cowyo.init
sed -i 's^USERCUR^$(USERCUR)^g' jinstall/cowyo.init
sed -i 's^PORT^$(PORT)^g' jinstall/cowyo.init
mv jinstall/cowyo.init /etc/init.d/
chmod +x /etc/init.d/cowyo.init
mv jinstall/cowyo.nginx /etc/nginx/sites-available/cowyo.nginx
rm /etc/nginx/sites-enabled/cowyo.nginx
ln -s /etc/nginx-sites-available/cowyo.nginx /etc/nginx/sites-enabled/cowyo.nginx
/etc/init.d/nginx reload
/etc/init.d/nginx restart
/etc/init.d/cowyo.init restart
rm -rf jinstall
.PHONY: install