1
0
mirror of https://github.com/schollz/cowyo.git synced 2023-08-10 21:13:00 +03:00
cowyo/Makefile
Zack Scholl a8802d54fb Finalized makefile and install instructions
Former-commit-id: e62ce015320b8e1c1536f8665a0662a0884e5342 [formerly d2db21b71f3ec697fe1604dbb3a09198e07e3654] [formerly e57dd68fbed6b59ad3f6be9c5e4b479dfb447cd1 [formerly 73f500b4d3]]
Former-commit-id: e7f6b9d710814a0653aefd5371061de64f26e749 [formerly 2a78037d302a7e7e0d0f07b178ff0f01593d5cbb]
Former-commit-id: b9b8ee1b0ea53202e901bee323e686bde537835a
2016-02-08 13:00:23 -05:00

33 lines
1001 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 -fs /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