2016-03-19 18:31:47 +03:00
|
|
|
ADDRESS = cowyo.com
|
2016-02-10 22:11:26 +03:00
|
|
|
PORT = 8003
|
2016-02-08 20:15:29 +03:00
|
|
|
|
2016-02-08 19:30:14 +03:00
|
|
|
CUR_DIR = $(shell bash -c 'pwd')
|
2016-02-08 20:15:29 +03:00
|
|
|
USERCUR = $(shell bash -c 'whoami')
|
2016-02-08 19:30:14 +03:00
|
|
|
|
2016-02-08 20:34:06 +03:00
|
|
|
make:
|
|
|
|
go build
|
2016-02-08 20:46:54 +03:00
|
|
|
|
2016-02-08 20:34:06 +03:00
|
|
|
install:
|
2016-02-08 20:15:29 +03:00
|
|
|
rm -rf jinstall
|
|
|
|
mkdir jinstall
|
2016-03-19 18:31:47 +03:00
|
|
|
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
|
|
|
|
cp jinstall/cowyo.init /etc/init.d/cowyo.init
|
|
|
|
chmod +x /etc/init.d/cowyo.init
|
|
|
|
cp jinstall/cowyo.nginx /etc/nginx/sites-available/cowyo.nginx
|
|
|
|
ln -fs /etc/nginx/sites-available/cowyo.nginx /etc/nginx/sites-enabled/cowyo.nginx
|
2016-02-08 20:15:29 +03:00
|
|
|
/etc/init.d/nginx reload
|
|
|
|
/etc/init.d/nginx restart
|
2016-03-19 18:31:47 +03:00
|
|
|
/etc/init.d/cowyo.init restart
|
2016-02-08 20:15:29 +03:00
|
|
|
rm -rf jinstall
|
2016-02-08 20:46:54 +03:00
|
|
|
|
2016-02-16 00:59:32 +03:00
|
|
|
binaries:
|
|
|
|
rm -rf binaries
|
2016-03-19 18:31:47 +03:00
|
|
|
rm -f cowyo
|
2016-02-16 00:59:32 +03:00
|
|
|
mkdir binaries
|
2016-03-19 18:31:47 +03:00
|
|
|
env GOOS=linux GOARCH=amd64 go build -o cowyo -v *.go
|
|
|
|
zip -9 -r cowyo-linux-64bit.zip cowyo static/* templates/*
|
|
|
|
rm -f cowyo
|
|
|
|
env GOOS=windows GOARCH=amd64 go build -o cowyo.exe -v *.go
|
|
|
|
zip -9 -r cowyo-windows-64bit.zip cowyo.exe static/* templates/*
|
|
|
|
rm -f cowyo.exe
|
|
|
|
env GOOS=linux GOARCH=arm go build -o cowyo -v *.go
|
|
|
|
zip -9 -r cowyo-raspberrypi.zip cowyo static/* templates/*
|
|
|
|
rm -f cowyo
|
|
|
|
env GOOS=darwin GOARCH=amd64 go build -o cowyo -v *.go
|
|
|
|
zip -9 -r cowyo-macosx-64bit.zip cowyo static/* templates/*
|
|
|
|
rm -f cowyo
|
2016-02-16 01:22:06 +03:00
|
|
|
mv *.zip binaries/
|
2016-02-16 00:59:32 +03:00
|
|
|
|
|
|
|
|
2016-02-08 20:46:54 +03:00
|
|
|
.PHONY: install
|
2016-03-19 18:31:47 +03:00
|
|
|
.PHONY: binaries
|