Travis每次提交构建两次(每个构建两个任务)

时间:2017-12-27 20:31:59

标签: java travis-ci

示例构建:https://travis-ci.org/sscarduzio/elasticsearch-readonlyrest-plugin/builds/322220103

注意每个提交有1个构建,每个构建有 2个相同的并行任务。这是一个问题,因为每个构建都需要永远!

我的.travis.yml配置:

sudo: required
dist: trusty
group: deprecated-2017Q4

language: java

sudo: required

services:
  - docker

jdk:
- oraclejdk8

branches:
  except:
    - /^v[0-9].*es/

script: bin/build.sh

deploy:
  provider: script
  script: ci/ci-deploy.sh
  skip_cleanup: true
  on:
    all_branches: true
    tags: false

env:
- GH_USER_EMAIL=scarduzio+travisci@gmail.com
- GH_USER_NAME=Travis CI

before_script:
  - sudo sysctl -w vm.max_map_count=262144

after_success:
- |

       declare -r SSH_FILE="$HOME/.ssh/gh_identity)"

       # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

       # Decrypt the file containing the private key

       openssl aes-256-cbc \
         -K $encrypted_bf4db9d5783b_key -iv $encrypted_bf4db9d5783b_iv \
         -in ".travis/github_deploy_key.enc" \
         -out "$SSH_FILE" -d

       # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

       # Enable SSH authentication

       chmod 600 "$SSH_FILE" \
         && printf "%s\n" \
              "Host github.com" \
              "  IdentityFile $SSH_FILE" \
              "  LogLevel ERROR" >> ~/.ssh/config

```

1 个答案:

答案 0 :(得分:0)

这是由env配置引起的。特拉维斯认为这是build matrix。我认为正确的方法是使用全局密钥:

env:
  global:
    - GH_USER_EMAIL=
    - GH_USER_NAME=