Files
eiblog/.travis.yml
2016-10-02 12:27:49 +08:00

30 lines
1.1 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
sudo: required # 声明构建语言环境
dist: trusty # 在ubuntu:trusty
notifications: # 每次构建的时候是否通知如果不想收到通知邮箱个人感觉邮件贼烦那就设置false吧
email: false
language: go # 声明构建语言环境
go: # 只构建最新版本
- tip
service: # docker环境
- docker
branches: # 限定项目分支
only:
- master
before_install:
- curl https://glide.sh/get | sh # 安装glide包管理
script:
- glide up
- CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build # 编译版本
- docker build -t registry.cn-hangzhou.aliyuncs.com/deepzz/eiblog . # 构建镜像
after_success:
- if [ "$TRAVIS_BRANCH" == "master" ]; then
docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD" registry.cn-hangzhou.aliyuncs.com;
docker push registry.cn-hangzhou.aliyuncs.com/deepzz/eiblog;
fi # push到镜像仓库