#!/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/minio-into-stck/minio-into-stck $ROOT/ cp -rf $ROOT/config $ROOT/minio-into-stck/ # ----- End build ----- cp -rf $ROOT/minio-into-stck $ROOT/tmp/ cp -rf $ROOT/minio-into-stck-installer $ROOT/tmp/ mkdir -p $ROOT/tmp/minio-into-stck/lib mkdir -p $ROOT/tmp/minio-into-stck/log cd $ROOT/tmp tar -zcf $ROOT/tmp/minio-into-stck-installer/minio-into-stck.tar.gz minio-into-stck cd $ROOT if [ ! -d "release" ]; then mkdir -p release fi cd $ROOT/tmp tar -zcf $ROOT/release/minio-into-stck-installer-v${cur_date}.tar.gz minio-into-stck-installer rm -rf $ROOT/tmp/* rmdir $ROOT/tmp echo "打包成功"