1
0
mirror of https://github.com/schollz/cowyo.git synced 2023-08-10 21:13:00 +03:00
cowyo/Makefile
Zack Scholl df5b282469 Added makefile
Former-commit-id: 29e2e80bb4a1a5b2a17f95ef289f59dc42e0b551 [formerly 106388272c4de662e074b0a9b3e1647840087469] [formerly c3c4a7cac5642ed57afa1ad7dd5e5d48e56e76b4 [formerly da82a40ffd]]
Former-commit-id: 575dcebbfc6b432242f8b2effd353d1a46146758 [formerly 2bc14c293430d023c85f099816d38696e0d8569d]
Former-commit-id: 9bc0641eddccb6a2787fd4e3be1ef38924bc0457
2016-02-08 12:34:06 -05:00

31 lines
984 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