forked from DanielG/travis-run
-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.md.in
112 lines (86 loc) · 3.2 KB
/
README.md.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
travis-run
==========
*travis-run* creates virtual machines resembling the build environment provided
by the *travis-ci.org* continuous integration service. This is so one can run
and debug builds locally, which should take most of the guesswork out of fixing
problems that only occur on travis-ci but not on the developer's machine. To do
this, we use the same chef-solo cookbooks used by travis-ci and generate the
script to drive the build from the .travis.yml file using the ruby libraries
published by them.
Installation
============
The simplest way to install *travis-run* is to just clone it and add the
resulting directory to your *PATH*:
```
$ git clone https://github.com/DanielG/travis-run.git
$ cd travis-run
$ git checkout $(git describe | awk -vFS=- '{ print $1 }') # chekout latest release
$ export PATH=$PATH:$PWD # also put that it in your shell's rc file
```
If you want to get more fancy the following installation methods are also
available:
Debian
------
```
# apt-get install devscripts
$ git clone https://github.com/DanielG/travis-run.git
$ cd travis-run
$ git checkout $(git describe | awk -vFS=- '{ print $1 }') # chekout latest release
$ debuild -uc -us
# dpkg -i ../travis-run_*.deb
```
OS X
----
Install *boot2docker* using the osx-installer from here: https://github.com/boot2docker/osx-installer/releases
**DONT** use the homebrew package for *boot2docker* (or at least you're on your
own if you do) as I couldn't get it to work reliably with
*travis-run*. Patches welcome etc. ;)
```
$ brew tap andy-morris/homebrew-extra
$ brew install travis-run
$ boot2docker init
```
Usage
=====
- Create a virtual machine: `travis-run create`
You should run this in your project directory.
This will create a directory `.travis-run/` that will contain a *Dockerfile*
which you may modify and commit to version control.
- Run your builds locally: `travis-run`
This will create a new docker container, copy the build directory into the
container and execute the build as it would be on travis-ci. Different
configurations (i.e. different runtime versions/`env` variables) will be run
one after another.
If you just want to run a certain build, first see which ones are avalable:
```
$ travis-run matrix
docker: Generating build script...done
0: "ghc: 7.4"
1: "ghc: 7.6"
2: "ghc: 7.8"
```
Now pick one and use either the BUILD_ID in the first column or the BUILD_LABEL
in quotes to specify which one to build, like so:
```
$ travis-run run "ghc: 7.6"
docker: Generating build script...done
docker: Starting container from image adafd960790c...done
docker: Waiting for ssh to come up (this takes a while)...done
Running build: "ghc: 7.6"
docker: Copying directory into container...done
[...build runs...]
Build failed, please investigate.
Welcome to Ubuntu 12.04.4 LTS (GNU/Linux 3.14-1-amd64 x86_64)
* Documentation: https://help.ubuntu.com/
Last login: Tue Jul 1 02:34:20 2014 from 172.17.42.1
travis@8f5a20acf357:~$ ls
drwxrwxr-x 1 travis travis 298 Jul 1 02:36 build
travis@8f5a20acf357:~$
```
Once you're done debugging your problem just `exit` the shell.
IRC
===
If you have any problems, suggestions or comments swing by
[#travis-run](irc://chat.freenode.net/trais-run) on Freenode.
Man Page
========