【问题标题】:Travis builds twice every commit (two tasks per build)Travis 每次提交构建两次(每次构建两个任务)
【发布时间】:2017-12-28 06:32:41
【问题描述】:

示例构建: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

```

【问题讨论】:

  • 您能否尝试只保留env 参数之一,而不是GH_USER_EMAILGH_USER_NAME?我认为这会导致您的构建运行两次。

标签: java travis-ci


【解决方案1】:

这是由env 配置引起的。 Travis 将此视为build matrix。我相信正确的方法是使用全局密钥:

env:
  global:
    - GH_USER_EMAIL=
    - GH_USER_NAME=

【讨论】:

    猜你喜欢
    • 2020-12-21
    • 2016-04-30
    • 1970-01-01
    • 1970-01-01
    • 2020-06-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多