如何重现用于调试的 travis-ci 构建环境 [英] How to reproduce a travis-ci build environment for debugging

查看:29
本文介绍了如何重现用于调试的 travis-ci 构建环境的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 travis-ci 上看到构建失败,我无法在本地机器上重现.是否有设置与 travis-ci linux 构建环境相同的 VM 的说明?我很高兴 travis-ci 已经揭示了一个新错误,但通过发送添加调试代码的提交来调试它并不那么兴奋.

I am seeing a build failure on travis-ci, which I cannot reproduce on my local machine. Are there instructions somewhere for setting up a VM that is identical to the travis-ci linux build environment? I'm glad to have travis-ci already reveal a new bug, but less excited to debug it by sending in commits that add debug code.

推荐答案

对于基于容器的构建,现在有 有关如何在本地设置 Docker 映像的说明.

For container-based builds, there are now instructions on how to setup a docker image locally.

不幸的是,相当多的步骤仍然是手动的.以下是启动和运行所需的命令:

Unfortunately, quite a few steps are still manual. Here are the commands you need to get it up and running:

# 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 构建环境的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆