diff --git a/.travis.yml b/.travis.yml index 28fbcae..12fe5e3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,9 +10,9 @@ go: # 只构建最新版本 services: # docker环境 - docker -branches: # 限定项目分支 - only: - - master +# branches: # 限定项目分支 +# only: +# - master before_install: - curl https://glide.sh/get | sh # 安装glide包管理 @@ -22,6 +22,12 @@ script: - 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 + before_deploy: - ./dist.sh @@ -36,9 +42,3 @@ deploy: tags: true repo: eiblog/eiblog all_branches: true - -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