package.sh 771 B

12345678910111213141516171819202122232425262728293031323334353637
  1. #!/bin/bash
  2. # set -e
  3. cur_date="`date +%Y-%m-%d`"
  4. ROOT=$(cd `dirname $0`; pwd)
  5. mkdir -p $ROOT/tmp
  6. rm -rf $ROOT/tmp/*
  7. # ----- Start build -----
  8. go build -o $ROOT/minio-into-stck/minio-into-stck $ROOT/
  9. cp -rf $ROOT/config $ROOT/minio-into-stck/
  10. # ----- End build -----
  11. cp -rf $ROOT/minio-into-stck $ROOT/tmp/
  12. cp -rf $ROOT/minio-into-stck-installer $ROOT/tmp/
  13. mkdir -p $ROOT/tmp/minio-into-stck/lib
  14. mkdir -p $ROOT/tmp/minio-into-stck/log
  15. cd $ROOT/tmp
  16. tar -zcf $ROOT/tmp/minio-into-stck-installer/minio-into-stck.tar.gz minio-into-stck
  17. cd $ROOT
  18. if [ ! -d "release" ]; then
  19. mkdir -p release
  20. fi
  21. cd $ROOT/tmp
  22. tar -zcf $ROOT/release/minio-into-stck-installer-v${cur_date}.tar.gz minio-into-stck-installer
  23. rm -rf $ROOT/tmp/*
  24. rmdir $ROOT/tmp
  25. echo "打包成功"