【问题标题】:Problem with creating github release via travis-ci with body content通过带有正文内容的 travis-ci 创建 github 版本的问题
【发布时间】:2019-04-26 22:38:06
【问题描述】:

我需要帮助或解释如何通过 Travis-CI 部署到 github 版本

我有一部分.travis.yml 配置文件

jobs:
  include:
    - stage: publish
      if: env(BRANCH_IS_TAG) != true
      name: "Create Github Release"
      script:
        - yarn build
        - bash ./prepare-publish.sh
      deploy:
        provider: releases
        name: "Release ${PACKAGE_VERSION}"
        body: "test \n test \r\n + /r/n *"
        overwrite: true
        skip_cleanup: true
        api_key:
          secure: ${GITHUB_TOKEN}
        file:
          - release.zip
        on:
          all_branches: true
          repo: acacode/stonex

这部分配置工作正常,而我不更改此行

  body: "test \n test \r\n + /r/n *"

  body: "${GIT_LOG}"

此变量是在 prepare-publish.sh 脚本中的部署部分之前创建的

export GIT_LOG=$(git cherry -v develop)

并输出:

当我将此变量附加到正文时,特拉维斯说我

   invalid option "--body="

travis 配置文件:https://raw.githubusercontent.com/acacode/stonex/internal/travis-ci-builds/.travis.yml

travis 构建日志有这个问题: https://travis-ci.org/acacode/stonex/builds/524606655#L543

包含$GIT_LOG 变量的脚本: https://github.com/acacode/stonex/blob/internal/travis-ci-builds/prepare-publish.sh

希望得到您的帮助,谢谢!

【问题讨论】:

    标签: github travis-ci continuous-deployment github-release


    【解决方案1】:

    似乎传递body 选项是travis-ci 部署中的一个现有错误,尚未修复:https://github.com/travis-ci/dpl/issues/155

    【讨论】:

    • 是的,你是对的!但是我的配置还有一些额外的问题,比如在子 bash 脚本中创建环境变量并在 travis 配置中使用它们。如果有人想做同样的事情,比如通过 Travis 在 github 上发布。最好在 nodejs 或 ruby​​ 上使用自定义脚本
    猜你喜欢
    • 2019-01-26
    • 1970-01-01
    • 1970-01-01
    • 2014-11-13
    • 2014-04-17
    • 2017-08-03
    • 2018-05-24
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多