forked from travis-ci/travis-ci.github.com
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
242 lines (187 loc) · 8.69 KB
/
index.html
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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
<!DOCTYPE HTML>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Travis CI: About - Build Configuration</title>
<link rel="stylesheet" type="text/css" href="/style.css" media="screen">
</head>
<body>
<div id="navigation">
<div class="wrapper">
<a href="http://travis-ci.org" id="logo">travis-ci<span>.org</span></a>
<ul>
<li><a href="/">Blog</a></li>
<li><a href="/docs/">Docs</a></li>
<li class="right"><a href="http://travis-ci.org">go to travis-ci.org →</a></li>
</ul>
</div>
</div>
<div id="header">
<div class="wrapper">
<h1 class="riddle"><a href="/" title="Travis">Travis CI</a></h1>
<p>An open-source, distributed build system for the open source community.</p>
</div><!-- /.wrapper -->
</div><!-- /#header -->
<div id="content">
<div class="wrapper">
<div class="pad">
<div id="main">
<h2>Build Configuration</h2>
<p>The <code>.travis.yml</code> file in the root of your repo allows you configure your builds. Travis CI will always look for the <code>.travis.yml</code> file that is contained in the tree specified by the git commit that Github has passed.</p>
<p>This configuration in one branch will not affect the build of another, separate branch. Also, Travis CI will build after <em>any</em> git push to your GitHub project, regardless of the branch and whether it has the configuration file or not. You can limit this behavior with configuration options.</p>
<p>By default, the worker performs the build as following:</p>
<pre><code>$ rvm use 1.8.7
$ git clone git://github.com/YOUR/PROJECT.git
$ bundle install --path vendor/bundle
$ bundle exec rake
</code></pre>
<p>If your project is not using Bundler (no Gemfile), it will only run <code>rake</code>.</p>
<p>The outcome of this last command – the build script – indicates whether or not this build has failed or passed. The standard unix exit code of “0” means it passed; everything else is treated as failure.</p>
<p>With the exception of <code>git clone</code> command, all of the above steps can be tweaked with <code>.travis.yml</code>.</p>
<h3>Choose a Ruby version</h3>
<p>To specify the Ruby version to test against, use the <code>rvm</code> option:</p>
<pre><code>rvm: 1.9.2
</code></pre>
<h3>Specify a Gemfile</h3>
<p>You can specify a custom Gemfile name:</p>
<pre><code>gemfile: gemfiles/Gemfile.ci
</code></pre>
<p>Unless specified, the worker will look for a file named “Gemfile” in the root of your project.</p>
<p>You can also set <a href="http://gembundler.com/man/bundle-install.1.html">extra arguments</a> to be passed to <code>bundle install</code>:</p>
<pre><code>bundler_args: --binstubs
</code></pre>
<h3>Set environment variables</h3>
<p>To specify an environment variable:</p>
<pre><code>env: DB=postgres
</code></pre>
<p>Environment variables are useful for configuring build scripts. See the example in <a href="/docs/user/database-setup/#multiple-database-systems">Database setup</a>. One variable is always present during your builds, <code>TRAVIS</code>:</p>
<pre><code>if ENV['TRAVIS']
# do something specific to continuous integration
end
</code></pre>
<h3>The build matrix</h3>
<p>When you combine the three main configuration options above, Travis CI will run your tests against a matrix of all possible combinations. The 3 matrix dimensions are:</p>
<ul>
<li><code>rvm</code> - Ruby interpreters to test against</li>
<li><code>gemfile</code> - different sets of dependencies to test against</li>
<li><code>env</code> - environment variables with which you can configure your build scripts</li>
</ul>
<p>Below is an example configuration for a rather big build matrix that expands to <strong>32 individual</strong> builds.</p>
<p>Please take into account that Travis CI is an open source service and we rely on worker boxes provided by the community. So please only specify an as big matrix as you <em>actually need</em>.</p>
<pre><code>rvm:
- 1.8.6
- 1.8.7 # (current default)
- 1.9.2
- rbx
- rbx-2.0
- ree
- jruby
- ruby-head
gemfile:
- gemfiles/Gemfile.rails-2.3.x
- gemfiles/Gemfile.rails-3.0.x
env:
- ISOLATED=true
- ISOLATED=false
</code></pre>
<h3>Define a custom build script</h3>
<p>You can specify the main build command to run instead of just <code>rake</code>:</p>
<pre><code>script: "bundle exec rake db:drop db:create db:migrate test"
</code></pre>
<p>The script can be any executable; it doesn’t have to be <code>rake</code>, and it doesn’t even have to start with <code>bundle exec</code> (it can bootstrap the bundle internally).</p>
<p>You can also define scripts to be run before and after the main script:</p>
<pre><code>before_script: some_command
after_script: another_command
</code></pre>
<p>Both settings support multiple scripts, too.</p>
<p>These scripts can be used to setup databases used for testing. For more information, see <a href="/docs/user/database-setup/">Database setup</a>.</p>
<h3>Recipients of email & IRC notification</h3>
<p>You can specify recipients that will be notified about build results.</p>
<pre><code>notifications:
recipients:
- one@example.com
- other@example.com
</code></pre>
<p>You can also entirely turn off notifications like this:</p>
<pre><code>notifications:
disabled: true
</code></pre>
<p>If you do not configure this then Travis CI will notify:</p>
<ul>
<li>for user repos: the commit author and the repository owner</li>
<li>for repos owned by an organization: the commit author and <em>all</em> organization members</li>
</ul>
<p>You can also specify notifications in an IRC channel:</p>
<pre><code>notifications:
irc: "irc.freenode.org#travis"
</code></pre>
<h3>Specify branches to build</h3>
<p>You can either white- or blacklist branches that you want to be built:</p>
<pre><code># blacklist
branches:
except:
- legacy
- experimental
# whitelist
branches:
only:
- master
- stable
</code></pre>
<p>If you specify both, “except” will be ignored.</p>
</div><!-- /#main -->
<div id="sidebar">
<h2>Contact</h2>
<ul>
<li><a href="http://github.com/travis-ci">Github</a></li>
<li><a href="http://twitter.com/travisci">Twitter</a></li>
<li><a href="irc://irc.freenode.net#travis">IRC</a></li>
<li><a href="http://groups.google.com/group/travis-ci">Mailinglist</a></li>
</ul>
<h2>User Docs</h2>
<ul>
<li><a href="/docs/user/getting-started/">Getting started</a></li>
<li><a href="/docs/user/build-configuration/">Build configuration</a></li>
<li><a href="/docs/user/database-setup/">Database setup</a></li>
<li><a href="/docs/user/status-images/">Status images</a></li>
<li><a href="/docs/user/resources/">Resources</a></li>
<li><a href="/docs/user/ci-environment/">CI environment</a></li>
</ul>
<h2>Languages</h2>
<ul>
<li><a href="/docs/user/languages/clojure/">Clojure</a></li>
<li><a href="/docs/user/languages/erlang/">Erlang</a></li>
<li><a href="/docs/user/languages/javascript-with-nodejs/">JavaScript (with Node.js)</a></li>
<li><a href="/docs/user/languages/ruby/">Ruby</a></li>
</ul>
<h2>Developer Docs</h2>
<ul>
<li><a href="/docs/dev/worker/">The worker</a></li>
<li><a href="/docs/dev/api/">The API</a></li>
</ul>
<h2>Under construction</h2>
<ul>
<li><p>Our site is still under construction. You can help us in: travis#irc.freenode.net</p></li>
</ul>
</div><!-- /#sidebar -->
</div><!-- /.pad -->
</div><!-- /.wrapper -->
</div><!-- /#content -->
<div id="footer">
<div class="wrapper">
<div class="box">
<p>This site is maintained by the <a href="http://github.com/travis-ci">Travis CI community</a>. Feel free to <a href="http://github.com/travis-ci/travis-ci.github.com">contribute</a>!</p>
</div>
<div class="box">
<p>This design was kindly provided by the talented Ben Webster of <a href="http://www.plus2.com.au">Plus2</a>.</p>
</div>
<div class="box last">
<ul>
<li><a href="http://github.com/travis-ci/travis-ci" title="">View the Source</a></li>
<li><a href="http://twitter.com/travisci" title="">Travis CI on Twitter</a></li>
</ul>
</div><!-- /.box -->
</div><!-- /.wrapper -->
</div><!-- /#footer -->
</body>
</html>