1 Star 0 Fork 0

葛祥营 / qor-example

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
deploy.sh 1.05 KB
一键复制 编辑 原始数据 按行查看 历史
jinzhu 提交于 2017-05-26 17:57 . Update deploy script
# 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
Go
1
https://gitee.com/hawxge/qor-example.git
git@gitee.com:hawxge/qor-example.git
hawxge
qor-example
qor-example
master

搜索帮助