123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- #!/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 -----
- if [ ! -r "$ROOT/bin/minio" ]; then
- echo "minio not found, downloading..."
- wget https://dl.min.io/server/minio/release/linux-amd64/minio -O $ROOT/bin/minio
- chmod +x $ROOT/bin/minio
- fi
- if [ ! -r "$ROOT/bin/mc" ]; then
- echo "mc not found, downloading..."
- wget https://dl.min.io/client/mc/release/linux-amd64/mc -O $ROOT/bin/mc
- chmod +x $ROOT/bin/mc
- fi
- mkdir -p $ROOT/minio-store/bin/
- cp -rf $ROOT/bin $ROOT/minio-store/
- chmod +x $ROOT/minio-store/bin/*
- cp -rf $ROOT/config $ROOT/minio-store/
- # ----- End build -----
- cp -rf $ROOT/minio-store $ROOT/tmp/
- cp -rf $ROOT/minio-store-installer $ROOT/tmp/
- mkdir -p $ROOT/tmp/minio-store/lib
- mkdir -p $ROOT/tmp/minio-store/log
- cd $ROOT/tmp
- tar -zcf $ROOT/tmp/minio-store-installer/minio-store.tar.gz minio-store
- cd $ROOT
- if [ ! -d "release" ]; then
- mkdir -p release
- fi
- cd $ROOT/tmp
- tar -zcf $ROOT/release/minio-store-installer-v${cur_date}.tar.gz minio-store-installer
- rm -rf $ROOT/tmp/*
- rmdir $ROOT/tmp
- echo "打包成功"
|