我的项目需要各种工具来构建。我已将这些工具放入Docker容器并将其推送到DockerHub。
现在我想配置Travis CI来使用这个Docker镜像构建我的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 |
+--------+--------+-------------+----------------+
分支的徽章master
的结果我的git pull
文件应该是什么样的?
答案 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.