代码拉取完成,页面将自动刷新
# Usage:
# ./deploy.sh production
# ./deploy.sh dev
if [ -n "$*" ]; then
env=$*
else
env=dev
fi
echo "Deploying \033[1;31m$env\033[0m from branch \033[1;33m$(git branch | sed -n '/\* /s///p')\033[0m..."
# build enterprise.go
echo "Building enterprise seeds..."
GOOS=linux GOARCH=amd64 go build -o db/seeds/enterprise -tags enterprise db/seeds/enterprise.go db/seeds/seeds.go
# build seeds.go
echo "Building main seeds..."
GOOS=linux GOARCH=amd64 go build -o db/seeds/main db/seeds/main.go db/seeds/seeds.go
go run -tags enterprise main.go -compile-templates=true
echo "Deploying..."
harp -s $env deploy
# please make sure you can run `ssh deployer@influxdb.theplant-dev.com`, or contact sa@theplant.jp
influxdb_table=$(git config --local remote.origin.url|sed -n 's#.*/\([^.]*\)\.git#\1#p')
user=$(git config user.name || whoami)
checksum=$(git rev-parse --short HEAD | tr -d '\n')
ssh deployer@influxdb.theplant-dev.com -- /home/deployer/deployment_record "$influxdb_table" "$user" "$env" "$checksum" || echo "failed to post data to influxdb"
harp -s $env log
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。