Travis CI在哪里提供我的源文件?

时间:2017-05-26 18:05:41

标签: git docker travis-ci

我的项目需要各种工具来构建。我已将这些工具放入Docker容器并将其推送到DockerHub。

现在我想配置Travis CI来使用这个Docker镜像构建我的GitHub项目。

我有什么:

  • DockerHub上图像的名称和发布
  • 构建项目的bash脚本(使用Docker镜像中的工具)
  • 公共Git回购

我想要实现的目标:

  • A" Build Passing" GitHub上+--------+--------+-------------+----------------+ | grp | job | Occurrences | FirstOccurance | +--------+--------+-------------+----------------+ | groupA | jobA-1 | 1 | 1 | | groupA | jobA-2 | 1 | 1 | | groupA | jobA-3 | 1 | 1 | | groupB | jobB-1 | 3 | 1 | | groupB | jobB-1 | 3 | NULL | | groupB | jobB-1 | 3 | NULL | +--------+--------+-------------+----------------+ 分支的徽章
  • 在GitHub上为PR生成master的结果

我的git pull文件应该是什么样的?

1 个答案:

答案 0 :(得分:3)

You can mount the clone/checkout of your PR that travis does for you as a volume into the docker container and then operate on that.

script: 
  - docker run -v ${TRAVIS_BUILD_DIR}:/root/src/ ${IMAGE} /root/src/some_script.sh

where some_script.sh in your repo runs whatever (test) steps you like. If you configure the travis build to also build PR (via the web frontend) this automagically does the right thing for the PR builds as well as branch pushes.

complete example yml