12345678910111213141516171819202122232425262728293031323334353637 |
- #!/bin/bash
- set -e
- cur_date="`date +%Y-%m-%d`"
- ROOT=$(cd `dirname $0`; pwd)
- mkdir -p $ROOT/tmp
- rm -rf $ROOT/tmp/*
- # ----- Start build -----
- go build -o $ROOT/watch-daemon/watch-daemon $ROOT/
- cp -rf $ROOT/config $ROOT/watch-daemon/
- # ----- End build -----
- cp -rf $ROOT/watch-daemon $ROOT/tmp/
- cp -rf $ROOT/watch-daemon-installer $ROOT/tmp/
- mkdir -p $ROOT/tmp/watch-daemon/lib
- mkdir -p $ROOT/tmp/watch-daemon/log
- cd $ROOT/tmp
- tar -zcf $ROOT/tmp/watch-daemon-installer/watch-daemon.tar.gz watch-daemon
- cd $ROOT
- if [ ! -d "release" ]; then
- mkdir -p release
- fi
- cd $ROOT/tmp
- tar -zcf $ROOT/release/watch-daemon-installer-v${cur_date}.tar.gz watch-daemon-installer
- rm -rf $ROOT/tmp/*
- rmdir $ROOT/tmp
- echo "打包成功"
|