package.sh 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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. if [ ! -r "$ROOT/bin/minio" ]; then
  9. echo "minio not found, downloading..."
  10. wget https://dl.min.io/server/minio/release/linux-amd64/minio -O $ROOT/bin/minio
  11. chmod +x $ROOT/bin/minio
  12. fi
  13. if [ ! -r "$ROOT/bin/mc" ]; then
  14. echo "mc not found, downloading..."
  15. wget https://dl.min.io/client/mc/release/linux-amd64/mc -O $ROOT/bin/mc
  16. chmod +x $ROOT/bin/mc
  17. fi
  18. mkdir -p $ROOT/minio-store/bin/
  19. cp -rf $ROOT/bin $ROOT/minio-store/
  20. chmod +x $ROOT/minio-store/bin/*
  21. cp -rf $ROOT/config $ROOT/minio-store/
  22. # ----- End build -----
  23. cp -rf $ROOT/minio-store $ROOT/tmp/
  24. cp -rf $ROOT/minio-store-installer $ROOT/tmp/
  25. mkdir -p $ROOT/tmp/minio-store/lib
  26. mkdir -p $ROOT/tmp/minio-store/log
  27. cd $ROOT/tmp
  28. tar -zcf $ROOT/tmp/minio-store-installer/minio-store.tar.gz minio-store
  29. cd $ROOT
  30. if [ ! -d "release" ]; then
  31. mkdir -p release
  32. fi
  33. cd $ROOT/tmp
  34. tar -zcf $ROOT/release/minio-store-installer-v${cur_date}.tar.gz minio-store-installer
  35. rm -rf $ROOT/tmp/*
  36. rmdir $ROOT/tmp
  37. echo "打包成功"