Open humingcheng opened 6 years ago
#!/bin/bash set -e set -x BASE_DIR="/e/tmp/go-chassis-release" PROJECT_NAME="go-chassis" TIMESTAMP=$(date +"%Y%m%d%H%M%S") export GOPATH=$BASE_DIR/$TIMESTAMP PROJECT_DIR=$GOPATH/src/$PROJECT_NAME mkdir -p $PROJECT_DIR # archive zip cd $BASE_DIR/$PROJECT_NAME git pull ZIP_PKG=$GOPATH/src/$PROJECT_NAME-$TIMESTAMP.zip git archive --format zip --output $ZIP_PKG --verbose head # update dependency cd $GOPATH/src unzip $ZIP_PKG -dq $PROJECT_DIR cd $PROJECT_DIR gvt restore # archive release pkg cd $GOPATH/src tar -zcvf $GOPATH/src/$PROJECT_NAME-$TIMESTAMP-relese.tar.gz $PROJECT_NAME