我在 travis-ci 上看到构建失败,我无法在本地机器上重现。是否有设置与 travis-ci linux 构建环境相同的 VM 的说明?我很高兴 travis-ci 已经揭示了一个新错误,但通过发送添加调试代码的提交来调试它并不那么兴奋。
最佳答案
对于基于容器的构建,现在有 instructions on how to setup a docker image locally 。
不幸的是,相当多的步骤仍然是手动的。以下是启动和运行它所需的命令:
# change the image according to the language chosen in .travis.yml
$ docker run -it -u travis quay.io/travisci/travis-jvm /bin/bash
# now that you are in the docker image, switch to the travis user
sudo su - travis
# Install a recent ruby (default is 1.9.3)
rvm install 2.3.0
rvm use 2.3.0
# Install travis-build to generate a .sh out of .travis.yml
cd builds
git clone https://github.com/travis-ci/travis-build.git
cd travis-build
gem install travis
travis # to create ~/.travis
ln -s `pwd` ~/.travis/travis-build
bundle install
# Create project dir, assuming your project is `me/project` on GitHub
cd ~/builds
mkdir me
cd me
git clone https://github.com/me/project.git
cd project
# change to the branch or commit you want to investigate
travis compile > ci.sh
# You most likely will need to edit ci.sh as it ignores matrix and env
bash ci.sh
关于travis-ci - 如何重现用于调试的 travis-ci 构建环境,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/29753560/