2016-02-10 20:14:40 +03:00
|
|
|
ADDRESS = awwkoala.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-02-10 20:14:40 +03:00
|
|
|
cp install/awwkoala.nginx jinstall/awwkoala.nginx
|
|
|
|
sed -i 's/PORT/$(PORT)/g' jinstall/awwkoala.nginx
|
|
|
|
sed -i 's/ADDRESS/$(ADDRESS)/g' jinstall/awwkoala.nginx
|
|
|
|
sed -i 's^CUR_DIR^$(CUR_DIR)^g' jinstall/awwkoala.nginx
|
|
|
|
cp install/awwkoala.init jinstall/awwkoala.init
|
|
|
|
sed -i 's/EXT_ADDRESS/$(ADDRESS)/g' jinstall/awwkoala.init
|
|
|
|
sed -i 's^CUR_DIR^$(CUR_DIR)^g' jinstall/awwkoala.init
|
|
|
|
sed -i 's^USERCUR^$(USERCUR)^g' jinstall/awwkoala.init
|
|
|
|
sed -i 's^PORT^$(PORT)^g' jinstall/awwkoala.init
|
2016-02-10 22:07:32 +03:00
|
|
|
cp jinstall/awwkoala.init /etc/init.d/awwkoala.init
|
2016-02-10 20:14:40 +03:00
|
|
|
chmod +x /etc/init.d/awwkoala.init
|
2016-02-10 22:07:32 +03:00
|
|
|
cp jinstall/awwkoala.nginx /etc/nginx/sites-available/awwkoala.nginx
|
2016-02-10 20:14:40 +03:00
|
|
|
ln -fs /etc/nginx/sites-available/awwkoala.nginx /etc/nginx/sites-enabled/awwkoala.nginx
|
2016-02-08 20:15:29 +03:00
|
|
|
/etc/init.d/nginx reload
|
|
|
|
/etc/init.d/nginx restart
|
2016-02-10 20:14:40 +03:00
|
|
|
/etc/init.d/awwkoala.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
|
|
|
|
rm -f awwkoala
|
|
|
|
mkdir binaries
|
|
|
|
env GOOS=linux GOARCH=amd64 go build -o awwkoala -v *.go
|
2016-02-16 01:22:06 +03:00
|
|
|
zip -9 -r awwkoala-linux-64bit.zip awwkoala static/* templates/*
|
2016-02-16 00:59:32 +03:00
|
|
|
rm -f awwkoala
|
2016-02-16 01:22:06 +03:00
|
|
|
env GOOS=windows GOARCH=amd64 go build -o awwkoala.exe -v *.go
|
|
|
|
zip -9 -r awwkoala-windows-64bit.zip awwkoala.exe static/* templates/*
|
|
|
|
rm -f awwkoala.exe
|
|
|
|
env GOOS=linux GOARCH=arm go build -o awwkoala -v *.go
|
|
|
|
zip -9 -r awwkoala-raspberrypi.zip awwkoala static/* templates/*
|
|
|
|
rm -f awwkoala
|
|
|
|
env GOOS=darwin GOARCH=amd64 go build -o awwkoala -v *.go
|
|
|
|
zip -9 -r awwkoala-macosx-64bit.zip awwkoala static/* templates/*
|
|
|
|
rm -f awwkoala
|
|
|
|
mv *.zip binaries/
|
2016-02-16 00:59:32 +03:00
|
|
|
|
|
|
|
|
2016-02-08 20:46:54 +03:00
|
|
|
.PHONY: install
|
2016-02-16 00:59:32 +03:00
|
|
|
.PHONY: binaries
|