jekyll-docs 3.3.1 → 3.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/site/404.html +3 -3
- data/site/community/index.html +5 -5
- data/site/css/screen.css +7 -6
- data/site/docs/assets/index.html +13 -5
- data/site/docs/collections/index.html +132 -29
- data/site/docs/conduct/index.html +16 -5
- data/site/docs/configuration/index.html +26 -8
- data/site/docs/continuous-integration/circleci/index.html +761 -0
- data/site/docs/continuous-integration/index.html +25 -245
- data/site/docs/continuous-integration/travis-ci/index.html +916 -0
- data/site/docs/contributing/index.html +41 -5
- data/site/docs/datafiles/index.html +14 -6
- data/site/docs/deployment-methods/index.html +17 -7
- data/site/docs/drafts/index.html +13 -5
- data/site/docs/extras/index.html +17 -6
- data/site/docs/frontmatter/index.html +13 -5
- data/site/docs/github-pages/index.html +68 -47
- data/site/docs/history/index.html +132 -9
- data/site/docs/home/index.html +13 -5
- data/site/docs/includes/index.html +824 -0
- data/site/docs/installation/index.html +16 -6
- data/site/docs/maintaining/affinity-team-captain/index.html +16 -5
- data/site/docs/maintaining/avoiding-burnout/index.html +16 -5
- data/site/docs/maintaining/becoming-a-maintainer/index.html +17 -6
- data/site/docs/maintaining/index.html +16 -5
- data/site/docs/maintaining/merging-a-pull-request/index.html +21 -6
- data/site/docs/maintaining/reviewing-a-pull-request/index.html +16 -5
- data/site/docs/maintaining/special-labels/index.html +16 -5
- data/site/docs/maintaining/triaging-an-issue/index.html +16 -5
- data/site/docs/migrations/index.html +13 -5
- data/site/docs/pages/index.html +33 -50
- data/site/docs/pagination/index.html +16 -5
- data/site/docs/permalinks/index.html +148 -66
- data/site/docs/plugins/index.html +39 -14
- data/site/docs/posts/index.html +32 -5
- data/site/docs/quickstart/index.html +57 -18
- data/site/docs/resources/index.html +21 -10
- data/site/docs/sites/index.html +18 -7
- data/site/docs/static-files/index.html +15 -7
- data/site/docs/structure/index.html +47 -32
- data/site/docs/templates/index.html +85 -89
- data/site/docs/themes/index.html +214 -63
- data/site/docs/troubleshooting/index.html +16 -5
- data/site/docs/upgrading/0-to-2/index.html +16 -5
- data/site/docs/upgrading/2-to-3/index.html +17 -6
- data/site/docs/upgrading/index.html +16 -5
- data/site/docs/usage/index.html +21 -6
- data/site/docs/variables/index.html +14 -6
- data/site/docs/windows/index.html +35 -10
- data/site/feed.xml +41 -22
- data/site/fonts/FontAwesome.eot +0 -0
- data/site/fonts/FontAwesome.svg +12 -0
- data/site/fonts/FontAwesome.ttf +0 -0
- data/site/fonts/FontAwesome.woff +0 -0
- data/site/help/index.html +3 -3
- data/site/icomoon-selection.json +96 -0
- data/site/index.html +3 -3
- data/site/latest_version.txt +1 -1
- data/site/news/2013/05/05/jekyll-1-0-0-released/index.html +12 -8
- data/site/news/2013/05/08/jekyll-1-0-1-released/index.html +11 -7
- data/site/news/2013/05/12/jekyll-1-0-2-released/index.html +11 -7
- data/site/news/2013/06/07/jekyll-1-0-3-released/index.html +11 -7
- data/site/news/2013/07/14/jekyll-1-1-0-released/index.html +11 -7
- data/site/news/2013/07/24/jekyll-1-1-1-released/index.html +12 -8
- data/site/news/2013/07/25/jekyll-1-0-4-released/index.html +11 -7
- data/site/news/2013/07/25/jekyll-1-1-2-released/index.html +11 -7
- data/site/news/2013/09/06/jekyll-1-2-0-released/index.html +11 -7
- data/site/news/2013/09/14/jekyll-1-2-1-released/index.html +11 -7
- data/site/news/2013/10/28/jekyll-1-3-0-rc1-released/index.html +11 -7
- data/site/news/2013/11/04/jekyll-1-3-0-released/index.html +11 -7
- data/site/news/2013/11/26/jekyll-1-3-1-released/index.html +11 -7
- data/site/news/2013/12/07/jekyll-1-4-0-released/index.html +11 -7
- data/site/news/2013/12/09/jekyll-1-4-1-released/index.html +11 -7
- data/site/news/2013/12/16/jekyll-1-4-2-released/index.html +11 -7
- data/site/news/2014/01/13/jekyll-1-4-3-released/index.html +11 -7
- data/site/news/2014/03/24/jekyll-1-5-0-released/index.html +11 -7
- data/site/news/2014/03/27/jekyll-1-5-1-released/index.html +11 -7
- data/site/news/2014/05/06/jekyll-turns-2-0-0/index.html +11 -7
- data/site/news/2014/05/08/jekyll-2-0-3-released/index.html +11 -7
- data/site/news/2014/06/04/jekyll-stickers-1-dollar-stickermule/index.html +12 -8
- data/site/news/2014/06/28/jekyll-turns-21-i-mean-2-1-0/index.html +12 -8
- data/site/news/2014/07/01/jekyll-2-1-1-released/index.html +11 -7
- data/site/news/2014/07/29/jekyll-2-2-0-released/index.html +11 -7
- data/site/news/2014/08/10/jekyll-2-3-0-released/index.html +11 -7
- data/site/news/2014/09/09/jekyll-2-4-0-released/index.html +11 -7
- data/site/news/2014/11/05/jekylls-midlife-crisis-jekyll-turns-2-5-0/index.html +11 -7
- data/site/news/2014/11/09/jekyll-2-5-1-released/index.html +11 -7
- data/site/news/2014/11/12/jekyll-2-5-2-released/index.html +11 -7
- data/site/news/2014/12/17/alfredxing-welcome-to-jekyll-core/index.html +12 -8
- data/site/news/2014/12/22/jekyll-2-5-3-released/index.html +11 -7
- data/site/news/2015/01/20/jekyll-meet-and-greet/index.html +11 -7
- data/site/news/2015/01/24/jekyll-3-0-0-beta1-released/index.html +11 -7
- data/site/news/2015/02/26/introducing-jekyll-talk/index.html +11 -7
- data/site/news/2015/10/26/jekyll-3-0-released/index.html +11 -7
- data/site/news/2015/11/17/jekyll-3-0-1-released/index.html +11 -7
- data/site/news/2016/01/20/jekyll-3-0-2-released/index.html +11 -7
- data/site/news/2016/01/24/jekyll-3-1-0-released/index.html +11 -7
- data/site/news/2016/01/28/jekyll-3-1-1-released/index.html +11 -7
- data/site/news/2016/02/08/jekyll-3-0-3-released/index.html +11 -7
- data/site/news/2016/02/19/jekyll-3-1-2-released/index.html +11 -7
- data/site/news/2016/03/10/making-it-easier-to-contribute-to-jekyll/index.html +11 -7
- data/site/news/2016/04/19/jekyll-3-0-4-released/index.html +11 -7
- data/site/news/2016/04/19/jekyll-3-1-3-released/index.html +11 -8
- data/site/news/2016/04/26/jekyll-3-0-5-released/index.html +11 -7
- data/site/news/2016/05/18/jekyll-3-1-4-released/index.html +11 -7
- data/site/news/2016/05/18/jekyll-3-1-5-released/index.html +11 -7
- data/site/news/2016/05/19/jekyll-3-1-6-released/index.html +11 -7
- data/site/news/2016/06/03/update-on-jekyll-s-google-summer-of-code-projects/index.html +11 -7
- data/site/news/2016/07/26/jekyll-3-2-0-released/index.html +11 -7
- data/site/news/2016/08/02/jekyll-3-2-1-released/index.html +11 -7
- data/site/news/2016/08/24/jekyll-admin-initial-release/index.html +12 -8
- data/site/news/2016/10/06/jekyll-3-3-is-here/index.html +12 -8
- data/site/news/2016/11/14/jekyll-3-3-1-released/index.html +11 -7
- data/site/news/2017/01/18/jekyll-3-4-0-released/index.html +570 -0
- data/site/news/index.html +81 -15
- data/site/news/releases/index.html +78 -12
- data/site/readme.md +9 -2
- data/site/sitemap.xml +59 -43
- metadata +14 -10
- data/site/fonts/fontawesome-webfont.eot +0 -0
- data/site/fonts/fontawesome-webfont.svg +0 -640
- data/site/fonts/fontawesome-webfont.ttf +0 -0
- data/site/fonts/fontawesome-webfont.woff +0 -0
- data/site/fonts/fontawesome-webfont.woff2 +0 -0
@@ -4,7 +4,7 @@
|
|
4
4
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
5
5
|
<meta charset="UTF-8">
|
6
6
|
<meta name="viewport" content="width=device-width,initial-scale=1">
|
7
|
-
<meta name="generator" content="Jekyll v3.
|
7
|
+
<meta name="generator" content="Jekyll v3.4.0">
|
8
8
|
<link type="application/atom+xml" rel="alternate" href="https://jekyllrb.com/feed.xml" title="Jekyll • Simple, blog-aware, static sites">
|
9
9
|
<link rel="alternate" type="application/atom+xml" title="Recent commits to Jekyll’s master branch" href="https://github.com/jekyll/jekyll/commits/master.atom">
|
10
10
|
<link rel="stylesheet" href="//fonts.googleapis.com/css?family=Lato:300,300italic,400,400italic,700,700italic,900">
|
@@ -13,13 +13,13 @@
|
|
13
13
|
<!-- Begin Jekyll SEO tag v2.1.0 -->
|
14
14
|
<title>Continuous Integration - Jekyll • Simple, blog-aware, static sites</title>
|
15
15
|
<meta property="og:title" content="Continuous Integration">
|
16
|
-
<meta name="description" content="
|
17
|
-
<meta property="og:description" content="
|
16
|
+
<meta name="description" content="Continuous Integration (CI) enables you to publish your Jekyll generated website with confidence by automating the quality assurance and deployment processes. You can quickly get started using CI with one of the providers below:">
|
17
|
+
<meta property="og:description" content="Continuous Integration (CI) enables you to publish your Jekyll generated website with confidence by automating the quality assurance and deployment processes. You can quickly get started using CI with one of the providers below:">
|
18
18
|
<link rel="canonical" href="https://jekyllrb.com/docs/continuous-integration/">
|
19
19
|
<meta property="og:url" content="https://jekyllrb.com/docs/continuous-integration/">
|
20
20
|
<meta property="og:site_name" content="Jekyll • Simple, blog-aware, static sites">
|
21
21
|
<meta property="og:type" content="article">
|
22
|
-
<meta property="article:published_time" content="2017-
|
22
|
+
<meta property="article:published_time" content="2017-03-22T08:06:48-07:00">
|
23
23
|
<meta name="twitter:card" content="summary">
|
24
24
|
<meta name="twitter:site" content="@jekyllrb">
|
25
25
|
<meta name="google-site-verification" content="onQcXpAvtHBrUI5LlroHNE_FP0b2qvFyPq7VZw36iEY">
|
@@ -27,8 +27,8 @@
|
|
27
27
|
{"@context": "http://schema.org",
|
28
28
|
"@type": "BlogPosting",
|
29
29
|
"headline": "Continuous Integration",
|
30
|
-
"datePublished": "2017-
|
31
|
-
"description": "
|
30
|
+
"datePublished": "2017-03-22T08:06:48-07:00",
|
31
|
+
"description": "Continuous Integration (CI) enables you to publish your Jekyll generated website with confidence by automating the quality assurance and deployment processes. You can quickly get started using CI with one of the providers below:",
|
32
32
|
"publisher": {"@type": "Organization",
|
33
33
|
"logo": {"@type": "ImageObject",
|
34
34
|
"url": "https://jekyllrb.com/img/logo-2x.png"}},
|
@@ -192,6 +192,10 @@
|
|
192
192
|
|
193
193
|
|
194
194
|
|
195
|
+
<option value="/docs/includes/">Includes</option>
|
196
|
+
|
197
|
+
|
198
|
+
|
195
199
|
<option value="/docs/permalinks/">Permalinks</option>
|
196
200
|
|
197
201
|
|
@@ -283,246 +287,15 @@
|
|
283
287
|
<div class="unit four-fifths">
|
284
288
|
<article>
|
285
289
|
<div class="improve right hide-on-mobiles">
|
286
|
-
<a href="https://github.com/jekyll/jekyll/edit/master/docs/_docs/continuous-integration.md"><i class="fa fa-pencil"></i> Improve this page</a>
|
290
|
+
<a href="https://github.com/jekyll/jekyll/edit/master/docs/_docs/continuous-integration/index.md"><i class="fa fa-pencil"></i> Improve this page</a>
|
287
291
|
</div>
|
288
292
|
<h1>Continuous Integration</h1>
|
289
|
-
<p>
|
290
|
-
The following guide will show you how to set up a free build environment on
|
291
|
-
<a href="https://travis-ci.org/">Travis</a>, with <a href="https://github.com/">GitHub</a> integration for pull requests. Paid
|
292
|
-
alternatives exist for private repositories.</p>
|
293
|
-
|
294
|
-
<h2 id="1-enabling-travis-and-github">1. Enabling Travis and GitHub</h2>
|
295
|
-
|
296
|
-
<p>Enabling Travis builds for your GitHub repository is pretty simple:</p>
|
297
|
-
|
298
|
-
<ol>
|
299
|
-
<li>Go to your profile on travis-ci.org: https://travis-ci.org/profile/username</li>
|
300
|
-
<li>Find the repository for which you’re interested in enabling builds.</li>
|
301
|
-
<li>Click the slider on the right so it says “ON” and is a dark grey.</li>
|
302
|
-
<li>Optionally configure the build by clicking on the gear icon. Further
|
303
|
-
configuration happens in your <code class="highlighter-rouge">.travis.yml</code> file. More details on that
|
304
|
-
below.</li>
|
305
|
-
</ol>
|
306
|
-
|
307
|
-
<h2 id="2-the-test-script">2. The Test Script</h2>
|
308
|
-
|
309
|
-
<p>The simplest test script simply runs <code class="highlighter-rouge">jekyll build</code> and ensures that Jekyll
|
310
|
-
doesn’t fail to build the site. It doesn’t check the resulting site, but it
|
311
|
-
does ensure things are built properly.</p>
|
312
|
-
|
313
|
-
<p>When testing Jekyll output, there is no better tool than <a href="https://github.com/gjtorikian/html-proofer">html-proofer</a>.
|
314
|
-
This tool checks your resulting site to ensure all links and images exist.
|
315
|
-
Utilize it either with the convenient <code class="highlighter-rouge">htmlproofer</code> command-line executable,
|
316
|
-
or write a Ruby script which utilizes the gem.</p>
|
317
|
-
|
318
|
-
<p>Save the commands you want to run and succeed in a file: <code class="highlighter-rouge">./script/cibuild</code></p>
|
319
|
-
|
320
|
-
<h3 id="the-html-proofer-executable">The HTML Proofer Executable</h3>
|
321
|
-
|
322
|
-
<div class="language-sh highlighter-rouge">
|
323
|
-
<pre class="highlight"><code><span class="c">#!/usr/bin/env bash</span>
|
324
|
-
<span class="nb">set</span> -e <span class="c"># halt script on error</span>
|
325
|
-
|
326
|
-
bundle <span class="nb">exec </span>jekyll build
|
327
|
-
bundle <span class="nb">exec </span>htmlproofer ./_site
|
328
|
-
</code></pre>
|
329
|
-
</div>
|
330
|
-
|
331
|
-
<p>Some options can be specified via command-line switches. Check out the
|
332
|
-
<code class="highlighter-rouge">html-proofer</code> README for more information about these switches, or run
|
333
|
-
<code class="highlighter-rouge">htmlproofer --help</code> locally.</p>
|
334
|
-
|
335
|
-
<p>For example to avoid testing external sites, use this command:</p>
|
336
|
-
|
337
|
-
<div class="language-sh highlighter-rouge">
|
338
|
-
<pre class="highlight"><code><span class="gp">$ </span>bundle <span class="nb">exec </span>htmlproofer ./_site --disable-external
|
339
|
-
</code></pre>
|
340
|
-
</div>
|
341
|
-
|
342
|
-
<h3 id="the-html-proofer-library">The HTML Proofer Library</h3>
|
343
|
-
|
344
|
-
<p>You can also invoke <code class="highlighter-rouge">html-proofer</code> in Ruby scripts (e.g. in a Rakefile):</p>
|
345
|
-
|
346
|
-
<div class="language-ruby highlighter-rouge">
|
347
|
-
<pre class="highlight"><code><span class="c1">#!/usr/bin/env ruby</span>
|
348
|
-
|
349
|
-
<span class="nb">require</span> <span class="s1">'html-proofer'</span>
|
350
|
-
<span class="no">HTMLProofer</span><span class="p">.</span><span class="nf">check_directory</span><span class="p">(</span><span class="s2">"./_site"</span><span class="p">).</span><span class="nf">run</span>
|
351
|
-
</code></pre>
|
352
|
-
</div>
|
353
|
-
|
354
|
-
<p>Options are given as a second argument to <code class="highlighter-rouge">.new</code>, and are encoded in a
|
355
|
-
symbol-keyed Ruby Hash. For more information about the configuration options,
|
356
|
-
check out <code class="highlighter-rouge">html-proofer</code>’s README file.</p>
|
357
|
-
|
358
|
-
<h2 id="3-configuring-your-travis-builds">3. Configuring Your Travis Builds</h2>
|
359
|
-
|
360
|
-
<p>This file is used to configure your Travis builds. Because Jekyll is built
|
361
|
-
with Ruby and requires RubyGems to install, we use the Ruby language build
|
362
|
-
environment. Below is a sample <code class="highlighter-rouge">.travis.yml</code> file, followed by
|
363
|
-
an explanation of each line.</p>
|
364
|
-
|
365
|
-
<p><strong>Note:</strong> You will need a Gemfile as well, <a href="https://docs.travis-ci.com/user/languages/ruby/#Dependency-Management">Travis will automatically install</a> the dependencies based on the referenced gems:</p>
|
366
|
-
|
367
|
-
<div class="language-ruby highlighter-rouge">
|
368
|
-
<pre class="highlight"><code><span class="n">source</span> <span class="s2">"https://rubygems.org"</span>
|
369
|
-
|
370
|
-
<span class="n">gem</span> <span class="s2">"jekyll"</span>
|
371
|
-
<span class="n">gem</span> <span class="s2">"html-proofer"</span>
|
372
|
-
</code></pre>
|
373
|
-
</div>
|
374
|
-
|
375
|
-
<p>Your <code class="highlighter-rouge">.travis.yml</code> file should look like this:</p>
|
376
|
-
|
377
|
-
<div class="language-yaml highlighter-rouge">
|
378
|
-
<pre class="highlight"><code><span class="s">language</span><span class="pi">:</span> <span class="s">ruby</span>
|
379
|
-
<span class="s">rvm</span><span class="pi">:</span>
|
380
|
-
<span class="pi">-</span> <span class="s">2.2.5</span>
|
381
|
-
|
382
|
-
<span class="s">before_script</span><span class="pi">:</span>
|
383
|
-
<span class="pi">-</span> <span class="s">chmod +x ./script/cibuild</span> <span class="c1"># or do this locally and commit</span>
|
384
|
-
|
385
|
-
<span class="c1"># Assume bundler is being used, therefore</span>
|
386
|
-
<span class="c1"># the `install` step will run `bundle install` by default.</span>
|
387
|
-
<span class="s">script</span><span class="pi">:</span> <span class="s">./script/cibuild</span>
|
388
|
-
|
389
|
-
<span class="c1"># branch whitelist, only for GitHub Pages</span>
|
390
|
-
<span class="s">branches</span><span class="pi">:</span>
|
391
|
-
<span class="s">only</span><span class="pi">:</span>
|
392
|
-
<span class="pi">-</span> <span class="s">gh-pages</span> <span class="c1"># test the gh-pages branch</span>
|
393
|
-
<span class="pi">-</span> <span class="s">/pages-(.*)/</span> <span class="c1"># test every branch which starts with "pages-"</span>
|
394
|
-
|
395
|
-
<span class="s">env</span><span class="pi">:</span>
|
396
|
-
<span class="s">global</span><span class="pi">:</span>
|
397
|
-
<span class="pi">-</span> <span class="s">NOKOGIRI_USE_SYSTEM_LIBRARIES=true</span> <span class="c1"># speeds up installation of html-proofer</span>
|
398
|
-
|
399
|
-
<span class="s">sudo</span><span class="pi">:</span> <span class="s">false</span> <span class="c1"># route your build to the container-based infrastructure for a faster build</span>
|
400
|
-
</code></pre>
|
401
|
-
</div>
|
402
|
-
|
403
|
-
<p>Ok, now for an explanation of each line:</p>
|
404
|
-
|
405
|
-
<div class="language-yaml highlighter-rouge">
|
406
|
-
<pre class="highlight"><code><span class="s">language</span><span class="pi">:</span> <span class="s">ruby</span>
|
407
|
-
</code></pre>
|
408
|
-
</div>
|
409
|
-
|
410
|
-
<p>This line tells Travis to use a Ruby build container. It gives your script
|
411
|
-
access to Bundler, RubyGems, and a Ruby runtime.</p>
|
412
|
-
|
413
|
-
<div class="language-yaml highlighter-rouge">
|
414
|
-
<pre class="highlight"><code><span class="s">rvm</span><span class="pi">:</span>
|
415
|
-
<span class="pi">-</span> <span class="s">2.2.5</span>
|
416
|
-
</code></pre>
|
417
|
-
</div>
|
418
|
-
|
419
|
-
<p>RVM is a popular Ruby Version Manager (like rbenv, chruby, etc). This
|
420
|
-
directive tells Travis the Ruby version to use when running your test
|
421
|
-
script.</p>
|
422
|
-
|
423
|
-
<div class="language-yaml highlighter-rouge">
|
424
|
-
<pre class="highlight"><code><span class="s">before_script</span><span class="pi">:</span>
|
425
|
-
<span class="pi">-</span> <span class="s">chmod +x ./script/cibuild</span>
|
426
|
-
</code></pre>
|
427
|
-
</div>
|
428
|
-
|
429
|
-
<p>The build script file needs to have the <em>executable</em> attribute set or
|
430
|
-
Travis will fail with a permission denied error. You can also run this
|
431
|
-
locally and commit the permissions directly, thus rendering this step
|
432
|
-
irrelevant.</p>
|
433
|
-
|
434
|
-
<div class="language-yaml highlighter-rouge">
|
435
|
-
<pre class="highlight"><code><span class="s">script</span><span class="pi">:</span> <span class="s">./script/cibuild</span>
|
436
|
-
</code></pre>
|
437
|
-
</div>
|
438
|
-
|
439
|
-
<p>Travis allows you to run any arbitrary shell script to test your site. One
|
440
|
-
convention is to put all scripts for your project in the <code class="highlighter-rouge">script</code>
|
441
|
-
directory, and to call your test script <code class="highlighter-rouge">cibuild</code>. This line is completely
|
442
|
-
customizable. If your script won’t change much, you can write your test
|
443
|
-
incantation here directly:</p>
|
444
|
-
|
445
|
-
<div class="language-yaml highlighter-rouge">
|
446
|
-
<pre class="highlight"><code><span class="s">install</span><span class="pi">:</span> <span class="s">gem install jekyll html-proofer</span>
|
447
|
-
<span class="s">script</span><span class="pi">:</span> <span class="s">jekyll build && htmlproofer ./_site</span>
|
448
|
-
</code></pre>
|
449
|
-
</div>
|
450
|
-
|
451
|
-
<p>The <code class="highlighter-rouge">script</code> directive can be absolutely any valid shell command.</p>
|
452
|
-
|
453
|
-
<div class="language-yaml highlighter-rouge">
|
454
|
-
<pre class="highlight"><code><span class="c1"># branch whitelist, only for GitHub Pages</span>
|
455
|
-
<span class="s">branches</span><span class="pi">:</span>
|
456
|
-
<span class="s">only</span><span class="pi">:</span>
|
457
|
-
<span class="pi">-</span> <span class="s">gh-pages</span> <span class="c1"># test the gh-pages branch</span>
|
458
|
-
<span class="pi">-</span> <span class="s">/pages-(.*)/</span> <span class="c1"># test every branch which starts with "pages-"</span>
|
459
|
-
</code></pre>
|
460
|
-
</div>
|
461
|
-
|
462
|
-
<p>You want to ensure the Travis builds for your site are being run only on
|
463
|
-
the branch or branches which contain your site. One means of ensuring this
|
464
|
-
isolation is including a branch whitelist in your Travis configuration
|
465
|
-
file. By specifying the <code class="highlighter-rouge">gh-pages</code> branch, you will ensure the associated
|
466
|
-
test script (discussed above) is only executed on site branches. If you use
|
467
|
-
a pull request flow for proposing changes, you may wish to enforce a
|
468
|
-
convention for your builds such that all branches containing edits are
|
469
|
-
prefixed, exemplified above with the <code class="highlighter-rouge">/pages-(.*)/</code> regular expression.</p>
|
470
|
-
|
471
|
-
<p>The <code class="highlighter-rouge">branches</code> directive is completely optional. Travis will build from every
|
472
|
-
push to any branch of your repo if leave it out.</p>
|
473
|
-
|
474
|
-
<div class="language-yaml highlighter-rouge">
|
475
|
-
<pre class="highlight"><code><span class="s">env</span><span class="pi">:</span>
|
476
|
-
<span class="s">global</span><span class="pi">:</span>
|
477
|
-
<span class="pi">-</span> <span class="s">NOKOGIRI_USE_SYSTEM_LIBRARIES=true</span> <span class="c1"># speeds up installation of html-proofer</span>
|
478
|
-
</code></pre>
|
479
|
-
</div>
|
480
|
-
|
481
|
-
<p>Using <code class="highlighter-rouge">html-proofer</code>? You’ll want this environment variable. Nokogiri, used
|
482
|
-
to parse HTML files in your compiled site, comes bundled with libraries
|
483
|
-
which it must compile each time it is installed. Luckily, you can
|
484
|
-
dramatically decrease the install time of Nokogiri by setting the
|
485
|
-
environment variable <code class="highlighter-rouge">NOKOGIRI_USE_SYSTEM_LIBRARIES</code> to <code class="highlighter-rouge">true</code>.</p>
|
486
|
-
|
487
|
-
<div class="note warning">
|
488
|
-
<h5>Be sure to exclude <code>vendor</code> from your
|
489
|
-
<code>_config.yml</code>
|
490
|
-
</h5>
|
491
|
-
<p>Travis bundles all gems in the <code>vendor</code> directory on its build
|
492
|
-
servers, which Jekyll will mistakenly read and explode on.</p>
|
493
|
-
</div>
|
494
|
-
|
495
|
-
<div class="language-yaml highlighter-rouge">
|
496
|
-
<pre class="highlight"><code><span class="s">exclude</span><span class="pi">:</span> <span class="pi">[</span><span class="nv">vendor</span><span class="pi">]</span>
|
497
|
-
</code></pre>
|
498
|
-
</div>
|
499
|
-
|
500
|
-
<p>By default you should supply the <code class="highlighter-rouge">sudo: false</code> command to Travis. This command
|
501
|
-
explicitly tells Travis to run your build on Travis’s <a href="https://docs.travis-ci.com/user/workers/container-based-infrastructure/#Routing-your-build-to-container-based-infrastructure">container-based
|
502
|
-
infrastructure</a>. Running on the container-based infrastructure can often times
|
503
|
-
speed up your build. If you have any trouble with your build, or if your build
|
504
|
-
does need <code class="highlighter-rouge">sudo</code> access, modify the line to <code class="highlighter-rouge">sudo: required</code>.</p>
|
505
|
-
|
506
|
-
<div class="language-yaml highlighter-rouge">
|
507
|
-
<pre class="highlight"><code><span class="s">sudo</span><span class="pi">:</span> <span class="s">false</span>
|
508
|
-
</code></pre>
|
509
|
-
</div>
|
510
|
-
|
511
|
-
<h3 id="troubleshooting">Troubleshooting</h3>
|
512
|
-
|
513
|
-
<p><strong>Travis error:</strong> <em>“You are trying to install in deployment mode after changing
|
514
|
-
your Gemfile. Run bundle install elsewhere and add the updated Gemfile.lock
|
515
|
-
to version control.”</em></p>
|
516
|
-
|
517
|
-
<p><strong>Workaround:</strong> Either run <code class="highlighter-rouge">bundle install</code> locally and commit your changes to
|
518
|
-
<code class="highlighter-rouge">Gemfile.lock</code>, or remove the <code class="highlighter-rouge">Gemfile.lock</code> file from your repository and add
|
519
|
-
an entry in the <code class="highlighter-rouge">.gitignore</code> file to avoid it from being checked in again.</p>
|
520
|
-
|
521
|
-
<h3 id="questions">Questions?</h3>
|
522
|
-
|
523
|
-
<p>This entire guide is open-source. Go ahead and <a href="https://github.com/jekyll/jekyll/edit/master/docs/_docs/continuous-integration.md">edit it</a> if you have a
|
524
|
-
fix or <a href="https://jekyllrb.com/help/">ask for help</a> if you run into trouble and need some help.</p>
|
293
|
+
<p>Continuous Integration (CI) enables you to publish your Jekyll generated website with confidence by automating the quality assurance and deployment processes. You can quickly get started using CI with one of the providers below:</p>
|
525
294
|
|
295
|
+
<ul>
|
296
|
+
<li><a href="travis-ci">Travis CI</a></li>
|
297
|
+
<li><a href="circleci">CircleCI</a></li>
|
298
|
+
</ul>
|
526
299
|
|
527
300
|
|
528
301
|
|
@@ -600,6 +373,9 @@ fix or <a href="https://jekyllrb.com/help/">ask for help</a> if you run into tro
|
|
600
373
|
|
601
374
|
|
602
375
|
|
376
|
+
|
377
|
+
|
378
|
+
|
603
379
|
|
604
380
|
|
605
381
|
|
@@ -713,6 +489,10 @@ fix or <a href="https://jekyllrb.com/help/">ask for help</a> if you run into tro
|
|
713
489
|
|
714
490
|
|
715
491
|
|
492
|
+
<li class=""><a href="/docs/includes/">Includes</a></li>
|
493
|
+
|
494
|
+
|
495
|
+
|
716
496
|
<li class=""><a href="/docs/permalinks/">Permalinks</a></li>
|
717
497
|
|
718
498
|
|
@@ -861,7 +641,7 @@ fix or <a href="https://jekyllrb.com/help/">ask for help</a> if you run into tro
|
|
861
641
|
</script>
|
862
642
|
|
863
643
|
|
864
|
-
<!-- Gauges (http://gaug.es/) -->
|
644
|
+
<!-- Gauges (http://get.gaug.es/) -->
|
865
645
|
<script>
|
866
646
|
var _gauges = _gauges || [];
|
867
647
|
(function() {
|
@@ -878,7 +658,7 @@ fix or <a href="https://jekyllrb.com/help/">ask for help</a> if you run into tro
|
|
878
658
|
|
879
659
|
|
880
660
|
|
881
|
-
<!-- Google Analytics (
|
661
|
+
<!-- Google Analytics (https://www.google.com/analytics) -->
|
882
662
|
<script>
|
883
663
|
!function(j,e,k,y,l,L){j.GoogleAnalyticsObject=y,j[y]||(j[y]=function(){
|
884
664
|
(j[y].q=j[y].q||[]).push(arguments)}),j[y].l=+new Date,l=e.createElement(k),
|
@@ -0,0 +1,916 @@
|
|
1
|
+
<!DOCTYPE HTML>
|
2
|
+
<html lang="en-US">
|
3
|
+
<head>
|
4
|
+
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
5
|
+
<meta charset="UTF-8">
|
6
|
+
<meta name="viewport" content="width=device-width,initial-scale=1">
|
7
|
+
<meta name="generator" content="Jekyll v3.4.0">
|
8
|
+
<link type="application/atom+xml" rel="alternate" href="https://jekyllrb.com/feed.xml" title="Jekyll • Simple, blog-aware, static sites">
|
9
|
+
<link rel="alternate" type="application/atom+xml" title="Recent commits to Jekyll’s master branch" href="https://github.com/jekyll/jekyll/commits/master.atom">
|
10
|
+
<link rel="stylesheet" href="//fonts.googleapis.com/css?family=Lato:300,300italic,400,400italic,700,700italic,900">
|
11
|
+
<link rel="stylesheet" href="/css/screen.css">
|
12
|
+
<link rel="icon" type="image/x-icon" href="/favicon.ico">
|
13
|
+
<!-- Begin Jekyll SEO tag v2.1.0 -->
|
14
|
+
<title>Travis CI - Jekyll • Simple, blog-aware, static sites</title>
|
15
|
+
<meta property="og:title" content="Travis CI">
|
16
|
+
<meta name="description" content="You can easily test your website build against one or more versions of Ruby. The following guide will show you how to set up a free build environment on Travis, with GitHub integration for pull requests.">
|
17
|
+
<meta property="og:description" content="You can easily test your website build against one or more versions of Ruby. The following guide will show you how to set up a free build environment on Travis, with GitHub integration for pull requests.">
|
18
|
+
<link rel="canonical" href="https://jekyllrb.com/docs/continuous-integration/travis-ci/">
|
19
|
+
<meta property="og:url" content="https://jekyllrb.com/docs/continuous-integration/travis-ci/">
|
20
|
+
<meta property="og:site_name" content="Jekyll • Simple, blog-aware, static sites">
|
21
|
+
<meta property="og:type" content="article">
|
22
|
+
<meta property="article:published_time" content="2017-03-22T08:06:48-07:00">
|
23
|
+
<meta name="twitter:card" content="summary">
|
24
|
+
<meta name="twitter:site" content="@jekyllrb">
|
25
|
+
<meta name="google-site-verification" content="onQcXpAvtHBrUI5LlroHNE_FP0b2qvFyPq7VZw36iEY">
|
26
|
+
<script type="application/ld+json">
|
27
|
+
{"@context": "http://schema.org",
|
28
|
+
"@type": "BlogPosting",
|
29
|
+
"headline": "Travis CI",
|
30
|
+
"datePublished": "2017-03-22T08:06:48-07:00",
|
31
|
+
"description": "You can easily test your website build against one or more versions of Ruby. The following guide will show you how to set up a free build environment on Travis, with GitHub integration for pull requests.",
|
32
|
+
"publisher": {"@type": "Organization",
|
33
|
+
"logo": {"@type": "ImageObject",
|
34
|
+
"url": "https://jekyllrb.com/img/logo-2x.png"}},
|
35
|
+
"url": "https://jekyllrb.com/docs/continuous-integration/travis-ci/"}</script>
|
36
|
+
<!-- End Jekyll SEO tag -->
|
37
|
+
|
38
|
+
<!--[if lt IE 9]>
|
39
|
+
<script src="/js/html5shiv.min.js"></script>
|
40
|
+
<script src="/js/respond.min.js"></script>
|
41
|
+
<![endif]-->
|
42
|
+
</head>
|
43
|
+
|
44
|
+
|
45
|
+
<body class="wrap">
|
46
|
+
<header>
|
47
|
+
<nav class="mobile-nav show-on-mobiles">
|
48
|
+
<ul>
|
49
|
+
<li class="">
|
50
|
+
<a href="/">Home</a>
|
51
|
+
</li>
|
52
|
+
<li class="current">
|
53
|
+
<a href="/docs/home/">Docs</a>
|
54
|
+
</li>
|
55
|
+
<li class="">
|
56
|
+
<a href="/news/">News</a>
|
57
|
+
</li>
|
58
|
+
<li class="">
|
59
|
+
<a href="/community/">Community</a>
|
60
|
+
</li>
|
61
|
+
<li class="">
|
62
|
+
<a href="/help/">Help</a>
|
63
|
+
</li>
|
64
|
+
<li>
|
65
|
+
<a href="https://github.com/jekyll/jekyll"><span class="hide-on-mobiles">View on </span>GitHub</a>
|
66
|
+
</li>
|
67
|
+
</ul>
|
68
|
+
|
69
|
+
</nav>
|
70
|
+
<div class="grid">
|
71
|
+
<div class="unit one-third center-on-mobiles">
|
72
|
+
<h1>
|
73
|
+
<a href="/">
|
74
|
+
<span class="sr-only">Jekyll</span>
|
75
|
+
<img src="/img/logo-2x.png" width="249" height="115" alt="Jekyll Logo">
|
76
|
+
</a>
|
77
|
+
</h1>
|
78
|
+
</div>
|
79
|
+
<nav class="main-nav unit two-thirds hide-on-mobiles">
|
80
|
+
<ul>
|
81
|
+
<li class="">
|
82
|
+
<a href="/">Home</a>
|
83
|
+
</li>
|
84
|
+
<li class="current">
|
85
|
+
<a href="/docs/home/">Docs</a>
|
86
|
+
</li>
|
87
|
+
<li class="">
|
88
|
+
<a href="/news/">News</a>
|
89
|
+
</li>
|
90
|
+
<li class="">
|
91
|
+
<a href="/community/">Community</a>
|
92
|
+
</li>
|
93
|
+
<li class="">
|
94
|
+
<a href="/help/">Help</a>
|
95
|
+
</li>
|
96
|
+
<li>
|
97
|
+
<a href="https://github.com/jekyll/jekyll"><span class="hide-on-mobiles">View on </span>GitHub</a>
|
98
|
+
</li>
|
99
|
+
</ul>
|
100
|
+
|
101
|
+
</nav>
|
102
|
+
</div>
|
103
|
+
</header>
|
104
|
+
|
105
|
+
|
106
|
+
<section class="docs">
|
107
|
+
<div class="grid">
|
108
|
+
|
109
|
+
<div class="docs-nav-mobile unit whole show-on-mobiles">
|
110
|
+
<select onchange="if (this.value) window.location.href=this.value">
|
111
|
+
<option value="">Navigate the docs…</option>
|
112
|
+
|
113
|
+
<optgroup label="Getting Started">
|
114
|
+
|
115
|
+
|
116
|
+
|
117
|
+
<option value="/docs/home/">Welcome</option>
|
118
|
+
|
119
|
+
|
120
|
+
|
121
|
+
<option value="/docs/quickstart/">Quick-start guide</option>
|
122
|
+
|
123
|
+
|
124
|
+
|
125
|
+
<option value="/docs/installation/">Installation</option>
|
126
|
+
|
127
|
+
|
128
|
+
|
129
|
+
<option value="/docs/usage/">Basic Usage</option>
|
130
|
+
|
131
|
+
|
132
|
+
|
133
|
+
<option value="/docs/structure/">Directory structure</option>
|
134
|
+
|
135
|
+
|
136
|
+
|
137
|
+
<option value="/docs/configuration/">Configuration</option>
|
138
|
+
|
139
|
+
|
140
|
+
</optgroup>
|
141
|
+
|
142
|
+
<optgroup label="Your Content">
|
143
|
+
|
144
|
+
|
145
|
+
|
146
|
+
<option value="/docs/frontmatter/">Front Matter</option>
|
147
|
+
|
148
|
+
|
149
|
+
|
150
|
+
<option value="/docs/posts/">Writing posts</option>
|
151
|
+
|
152
|
+
|
153
|
+
|
154
|
+
<option value="/docs/drafts/">Working with drafts</option>
|
155
|
+
|
156
|
+
|
157
|
+
|
158
|
+
<option value="/docs/pages/">Creating pages</option>
|
159
|
+
|
160
|
+
|
161
|
+
|
162
|
+
<option value="/docs/static-files/">Static Files</option>
|
163
|
+
|
164
|
+
|
165
|
+
|
166
|
+
<option value="/docs/variables/">Variables</option>
|
167
|
+
|
168
|
+
|
169
|
+
|
170
|
+
<option value="/docs/collections/">Collections</option>
|
171
|
+
|
172
|
+
|
173
|
+
|
174
|
+
<option value="/docs/datafiles/">Data Files</option>
|
175
|
+
|
176
|
+
|
177
|
+
|
178
|
+
<option value="/docs/assets/">Assets</option>
|
179
|
+
|
180
|
+
|
181
|
+
|
182
|
+
<option value="/docs/migrations/">Blog migrations</option>
|
183
|
+
|
184
|
+
|
185
|
+
</optgroup>
|
186
|
+
|
187
|
+
<optgroup label="Customization">
|
188
|
+
|
189
|
+
|
190
|
+
|
191
|
+
<option value="/docs/templates/">Templates</option>
|
192
|
+
|
193
|
+
|
194
|
+
|
195
|
+
<option value="/docs/includes/">Includes</option>
|
196
|
+
|
197
|
+
|
198
|
+
|
199
|
+
<option value="/docs/permalinks/">Permalinks</option>
|
200
|
+
|
201
|
+
|
202
|
+
|
203
|
+
<option value="/docs/pagination/">Pagination</option>
|
204
|
+
|
205
|
+
|
206
|
+
|
207
|
+
<option value="/docs/plugins/">Plugins</option>
|
208
|
+
|
209
|
+
|
210
|
+
|
211
|
+
<option value="/docs/themes/">Themes</option>
|
212
|
+
|
213
|
+
|
214
|
+
|
215
|
+
<option value="/docs/extras/">Extras</option>
|
216
|
+
|
217
|
+
|
218
|
+
</optgroup>
|
219
|
+
|
220
|
+
<optgroup label="Deployment">
|
221
|
+
|
222
|
+
|
223
|
+
|
224
|
+
<option value="/docs/github-pages/">GitHub Pages</option>
|
225
|
+
|
226
|
+
|
227
|
+
|
228
|
+
<option value="/docs/deployment-methods/">Deployment methods</option>
|
229
|
+
|
230
|
+
|
231
|
+
|
232
|
+
<option value="/docs/continuous-integration/">Continuous Integration</option>
|
233
|
+
|
234
|
+
|
235
|
+
</optgroup>
|
236
|
+
|
237
|
+
<optgroup label="Miscellaneous">
|
238
|
+
|
239
|
+
|
240
|
+
|
241
|
+
<option value="/docs/troubleshooting/">Troubleshooting</option>
|
242
|
+
|
243
|
+
|
244
|
+
|
245
|
+
<option value="/docs/sites/">Sites using Jekyll</option>
|
246
|
+
|
247
|
+
|
248
|
+
|
249
|
+
<option value="/docs/resources/">Resources</option>
|
250
|
+
|
251
|
+
|
252
|
+
|
253
|
+
<option value="/docs/upgrading/0-to-2/">Upgrading from 0.x to 2.x</option>
|
254
|
+
|
255
|
+
|
256
|
+
|
257
|
+
<option value="/docs/upgrading/2-to-3/">Upgrading from 2.x to 3.x</option>
|
258
|
+
|
259
|
+
|
260
|
+
</optgroup>
|
261
|
+
|
262
|
+
<optgroup label="Meta">
|
263
|
+
|
264
|
+
|
265
|
+
|
266
|
+
<option value="/docs/contributing/">Contributing</option>
|
267
|
+
|
268
|
+
|
269
|
+
|
270
|
+
<option value="/docs/maintaining/">Maintaining Jekyll</option>
|
271
|
+
|
272
|
+
|
273
|
+
|
274
|
+
<option value="/docs/conduct/">Code of Conduct</option>
|
275
|
+
|
276
|
+
|
277
|
+
|
278
|
+
<option value="/docs/history/">History</option>
|
279
|
+
|
280
|
+
|
281
|
+
</optgroup>
|
282
|
+
|
283
|
+
</select>
|
284
|
+
</div>
|
285
|
+
|
286
|
+
|
287
|
+
<div class="unit four-fifths">
|
288
|
+
<article>
|
289
|
+
<div class="improve right hide-on-mobiles">
|
290
|
+
<a href="https://github.com/jekyll/jekyll/edit/master/docs/_docs/continuous-integration/travis-ci.md"><i class="fa fa-pencil"></i> Improve this page</a>
|
291
|
+
</div>
|
292
|
+
<h1>Travis CI</h1>
|
293
|
+
<p>You can easily test your website build against one or more versions of Ruby.
|
294
|
+
The following guide will show you how to set up a free build environment on
|
295
|
+
<a href="https://travis-ci.org/">Travis</a>, with <a href="https://github.com/">GitHub</a> integration for pull requests.</p>
|
296
|
+
|
297
|
+
<h2 id="1-enabling-travis-and-github">1. Enabling Travis and GitHub</h2>
|
298
|
+
|
299
|
+
<p>Enabling Travis builds for your GitHub repository is pretty simple:</p>
|
300
|
+
|
301
|
+
<ol>
|
302
|
+
<li>Go to your profile on travis-ci.org: https://travis-ci.org/profile/username</li>
|
303
|
+
<li>Find the repository for which you’re interested in enabling builds.</li>
|
304
|
+
<li>Click the slider on the right so it says “ON” and is a dark grey.</li>
|
305
|
+
<li>Optionally configure the build by clicking on the gear icon. Further
|
306
|
+
configuration happens in your <code class="highlighter-rouge">.travis.yml</code> file. More details on that
|
307
|
+
below.</li>
|
308
|
+
</ol>
|
309
|
+
|
310
|
+
<h2 id="2-the-test-script">2. The Test Script</h2>
|
311
|
+
|
312
|
+
<p>The simplest test script simply runs <code class="highlighter-rouge">jekyll build</code> and ensures that Jekyll
|
313
|
+
doesn’t fail to build the site. It doesn’t check the resulting site, but it
|
314
|
+
does ensure things are built properly.</p>
|
315
|
+
|
316
|
+
<p>When testing Jekyll output, there is no better tool than <a href="https://github.com/gjtorikian/html-proofer">html-proofer</a>.
|
317
|
+
This tool checks your resulting site to ensure all links and images exist.
|
318
|
+
Utilize it either with the convenient <code class="highlighter-rouge">htmlproofer</code> command-line executable,
|
319
|
+
or write a Ruby script which utilizes the gem.</p>
|
320
|
+
|
321
|
+
<p>Save the commands you want to run and succeed in a file: <code class="highlighter-rouge">./script/cibuild</code></p>
|
322
|
+
|
323
|
+
<h3 id="the-html-proofer-executable">The HTML Proofer Executable</h3>
|
324
|
+
|
325
|
+
<div class="language-sh highlighter-rouge">
|
326
|
+
<pre class="highlight"><code><span class="c">#!/usr/bin/env bash</span>
|
327
|
+
<span class="nb">set</span> -e <span class="c"># halt script on error</span>
|
328
|
+
|
329
|
+
bundle <span class="nb">exec </span>jekyll build
|
330
|
+
bundle <span class="nb">exec </span>htmlproofer ./_site
|
331
|
+
</code></pre>
|
332
|
+
</div>
|
333
|
+
|
334
|
+
<p>Some options can be specified via command-line switches. Check out the
|
335
|
+
<code class="highlighter-rouge">html-proofer</code> README for more information about these switches, or run
|
336
|
+
<code class="highlighter-rouge">htmlproofer --help</code> locally.</p>
|
337
|
+
|
338
|
+
<p>For example to avoid testing external sites, use this command:</p>
|
339
|
+
|
340
|
+
<div class="language-sh highlighter-rouge">
|
341
|
+
<pre class="highlight"><code><span class="gp">$ </span>bundle <span class="nb">exec </span>htmlproofer ./_site --disable-external
|
342
|
+
</code></pre>
|
343
|
+
</div>
|
344
|
+
|
345
|
+
<h3 id="the-html-proofer-library">The HTML Proofer Library</h3>
|
346
|
+
|
347
|
+
<p>You can also invoke <code class="highlighter-rouge">html-proofer</code> in Ruby scripts (e.g. in a Rakefile):</p>
|
348
|
+
|
349
|
+
<div class="language-ruby highlighter-rouge">
|
350
|
+
<pre class="highlight"><code><span class="c1">#!/usr/bin/env ruby</span>
|
351
|
+
|
352
|
+
<span class="nb">require</span> <span class="s1">'html-proofer'</span>
|
353
|
+
<span class="no">HTMLProofer</span><span class="p">.</span><span class="nf">check_directory</span><span class="p">(</span><span class="s2">"./_site"</span><span class="p">).</span><span class="nf">run</span>
|
354
|
+
</code></pre>
|
355
|
+
</div>
|
356
|
+
|
357
|
+
<p>Options are given as a second argument to <code class="highlighter-rouge">.new</code>, and are encoded in a
|
358
|
+
symbol-keyed Ruby Hash. For more information about the configuration options,
|
359
|
+
check out <code class="highlighter-rouge">html-proofer</code>’s README file.</p>
|
360
|
+
|
361
|
+
<h2 id="3-configuring-your-travis-builds">3. Configuring Your Travis Builds</h2>
|
362
|
+
|
363
|
+
<p>This file is used to configure your Travis builds. Because Jekyll is built
|
364
|
+
with Ruby and requires RubyGems to install, we use the Ruby language build
|
365
|
+
environment. Below is a sample <code class="highlighter-rouge">.travis.yml</code> file, followed by
|
366
|
+
an explanation of each line.</p>
|
367
|
+
|
368
|
+
<p><strong>Note:</strong> You will need a Gemfile as well, <a href="https://docs.travis-ci.com/user/languages/ruby/#Dependency-Management">Travis will automatically install</a> the dependencies based on the referenced gems:</p>
|
369
|
+
|
370
|
+
<div class="language-ruby highlighter-rouge">
|
371
|
+
<pre class="highlight"><code><span class="n">source</span> <span class="s2">"https://rubygems.org"</span>
|
372
|
+
|
373
|
+
<span class="n">gem</span> <span class="s2">"jekyll"</span>
|
374
|
+
<span class="n">gem</span> <span class="s2">"html-proofer"</span>
|
375
|
+
</code></pre>
|
376
|
+
</div>
|
377
|
+
|
378
|
+
<p>Your <code class="highlighter-rouge">.travis.yml</code> file should look like this:</p>
|
379
|
+
|
380
|
+
<div class="language-yaml highlighter-rouge">
|
381
|
+
<pre class="highlight"><code><span class="s">language</span><span class="pi">:</span> <span class="s">ruby</span>
|
382
|
+
<span class="s">rvm</span><span class="pi">:</span>
|
383
|
+
<span class="pi">-</span> <span class="s">2.3.3</span>
|
384
|
+
|
385
|
+
<span class="s">before_script</span><span class="pi">:</span>
|
386
|
+
<span class="pi">-</span> <span class="s">chmod +x ./script/cibuild</span> <span class="c1"># or do this locally and commit</span>
|
387
|
+
|
388
|
+
<span class="c1"># Assume bundler is being used, therefore</span>
|
389
|
+
<span class="c1"># the `install` step will run `bundle install` by default.</span>
|
390
|
+
<span class="s">script</span><span class="pi">:</span> <span class="s">./script/cibuild</span>
|
391
|
+
|
392
|
+
<span class="c1"># branch whitelist, only for GitHub Pages</span>
|
393
|
+
<span class="s">branches</span><span class="pi">:</span>
|
394
|
+
<span class="s">only</span><span class="pi">:</span>
|
395
|
+
<span class="pi">-</span> <span class="s">gh-pages</span> <span class="c1"># test the gh-pages branch</span>
|
396
|
+
<span class="pi">-</span> <span class="s">/pages-(.*)/</span> <span class="c1"># test every branch which starts with "pages-"</span>
|
397
|
+
|
398
|
+
<span class="s">env</span><span class="pi">:</span>
|
399
|
+
<span class="s">global</span><span class="pi">:</span>
|
400
|
+
<span class="pi">-</span> <span class="s">NOKOGIRI_USE_SYSTEM_LIBRARIES=true</span> <span class="c1"># speeds up installation of html-proofer</span>
|
401
|
+
|
402
|
+
<span class="s">sudo</span><span class="pi">:</span> <span class="s">false</span> <span class="c1"># route your build to the container-based infrastructure for a faster build</span>
|
403
|
+
</code></pre>
|
404
|
+
</div>
|
405
|
+
|
406
|
+
<p>Ok, now for an explanation of each line:</p>
|
407
|
+
|
408
|
+
<div class="language-yaml highlighter-rouge">
|
409
|
+
<pre class="highlight"><code><span class="s">language</span><span class="pi">:</span> <span class="s">ruby</span>
|
410
|
+
</code></pre>
|
411
|
+
</div>
|
412
|
+
|
413
|
+
<p>This line tells Travis to use a Ruby build container. It gives your script
|
414
|
+
access to Bundler, RubyGems, and a Ruby runtime.</p>
|
415
|
+
|
416
|
+
<div class="language-yaml highlighter-rouge">
|
417
|
+
<pre class="highlight"><code><span class="s">rvm</span><span class="pi">:</span>
|
418
|
+
<span class="pi">-</span> <span class="s">2.3.3</span>
|
419
|
+
</code></pre>
|
420
|
+
</div>
|
421
|
+
|
422
|
+
<p>RVM is a popular Ruby Version Manager (like rbenv, chruby, etc). This
|
423
|
+
directive tells Travis the Ruby version to use when running your test
|
424
|
+
script.</p>
|
425
|
+
|
426
|
+
<div class="language-yaml highlighter-rouge">
|
427
|
+
<pre class="highlight"><code><span class="s">before_script</span><span class="pi">:</span>
|
428
|
+
<span class="pi">-</span> <span class="s">chmod +x ./script/cibuild</span>
|
429
|
+
</code></pre>
|
430
|
+
</div>
|
431
|
+
|
432
|
+
<p>The build script file needs to have the <em>executable</em> attribute set or
|
433
|
+
Travis will fail with a permission denied error. You can also run this
|
434
|
+
locally and commit the permissions directly, thus rendering this step
|
435
|
+
irrelevant.</p>
|
436
|
+
|
437
|
+
<div class="language-yaml highlighter-rouge">
|
438
|
+
<pre class="highlight"><code><span class="s">script</span><span class="pi">:</span> <span class="s">./script/cibuild</span>
|
439
|
+
</code></pre>
|
440
|
+
</div>
|
441
|
+
|
442
|
+
<p>Travis allows you to run any arbitrary shell script to test your site. One
|
443
|
+
convention is to put all scripts for your project in the <code class="highlighter-rouge">script</code>
|
444
|
+
directory, and to call your test script <code class="highlighter-rouge">cibuild</code>. This line is completely
|
445
|
+
customizable. If your script won’t change much, you can write your test
|
446
|
+
incantation here directly:</p>
|
447
|
+
|
448
|
+
<div class="language-yaml highlighter-rouge">
|
449
|
+
<pre class="highlight"><code><span class="s">install</span><span class="pi">:</span> <span class="s">gem install jekyll html-proofer</span>
|
450
|
+
<span class="s">script</span><span class="pi">:</span> <span class="s">jekyll build && htmlproofer ./_site</span>
|
451
|
+
</code></pre>
|
452
|
+
</div>
|
453
|
+
|
454
|
+
<p>The <code class="highlighter-rouge">script</code> directive can be absolutely any valid shell command.</p>
|
455
|
+
|
456
|
+
<div class="language-yaml highlighter-rouge">
|
457
|
+
<pre class="highlight"><code><span class="c1"># branch whitelist, only for GitHub Pages</span>
|
458
|
+
<span class="s">branches</span><span class="pi">:</span>
|
459
|
+
<span class="s">only</span><span class="pi">:</span>
|
460
|
+
<span class="pi">-</span> <span class="s">gh-pages</span> <span class="c1"># test the gh-pages branch</span>
|
461
|
+
<span class="pi">-</span> <span class="s">/pages-(.*)/</span> <span class="c1"># test every branch which starts with "pages-"</span>
|
462
|
+
</code></pre>
|
463
|
+
</div>
|
464
|
+
|
465
|
+
<p>You want to ensure the Travis builds for your site are being run only on
|
466
|
+
the branch or branches which contain your site. One means of ensuring this
|
467
|
+
isolation is including a branch whitelist in your Travis configuration
|
468
|
+
file. By specifying the <code class="highlighter-rouge">gh-pages</code> branch, you will ensure the associated
|
469
|
+
test script (discussed above) is only executed on site branches. If you use
|
470
|
+
a pull request flow for proposing changes, you may wish to enforce a
|
471
|
+
convention for your builds such that all branches containing edits are
|
472
|
+
prefixed, exemplified above with the <code class="highlighter-rouge">/pages-(.*)/</code> regular expression.</p>
|
473
|
+
|
474
|
+
<p>The <code class="highlighter-rouge">branches</code> directive is completely optional. Travis will build from every
|
475
|
+
push to any branch of your repo if leave it out.</p>
|
476
|
+
|
477
|
+
<div class="language-yaml highlighter-rouge">
|
478
|
+
<pre class="highlight"><code><span class="s">env</span><span class="pi">:</span>
|
479
|
+
<span class="s">global</span><span class="pi">:</span>
|
480
|
+
<span class="pi">-</span> <span class="s">NOKOGIRI_USE_SYSTEM_LIBRARIES=true</span> <span class="c1"># speeds up installation of html-proofer</span>
|
481
|
+
</code></pre>
|
482
|
+
</div>
|
483
|
+
|
484
|
+
<p>Using <code class="highlighter-rouge">html-proofer</code>? You’ll want this environment variable. Nokogiri, used
|
485
|
+
to parse HTML files in your compiled site, comes bundled with libraries
|
486
|
+
which it must compile each time it is installed. Luckily, you can
|
487
|
+
dramatically decrease the install time of Nokogiri by setting the
|
488
|
+
environment variable <code class="highlighter-rouge">NOKOGIRI_USE_SYSTEM_LIBRARIES</code> to <code class="highlighter-rouge">true</code>.</p>
|
489
|
+
|
490
|
+
<div class="note warning">
|
491
|
+
<h5>Be sure to exclude <code>vendor</code> from your
|
492
|
+
<code>_config.yml</code>
|
493
|
+
</h5>
|
494
|
+
<p>Travis bundles all gems in the <code>vendor</code> directory on its build
|
495
|
+
servers, which Jekyll will mistakenly read and explode on.</p>
|
496
|
+
</div>
|
497
|
+
|
498
|
+
<div class="language-yaml highlighter-rouge">
|
499
|
+
<pre class="highlight"><code><span class="s">exclude</span><span class="pi">:</span> <span class="pi">[</span><span class="nv">vendor</span><span class="pi">]</span>
|
500
|
+
</code></pre>
|
501
|
+
</div>
|
502
|
+
|
503
|
+
<p>By default you should supply the <code class="highlighter-rouge">sudo: false</code> command to Travis. This command
|
504
|
+
explicitly tells Travis to run your build on Travis’s <a href="https://docs.travis-ci.com/user/workers/container-based-infrastructure/#Routing-your-build-to-container-based-infrastructure">container-based
|
505
|
+
infrastructure</a>. Running on the container-based infrastructure can often times
|
506
|
+
speed up your build. If you have any trouble with your build, or if your build
|
507
|
+
does need <code class="highlighter-rouge">sudo</code> access, modify the line to <code class="highlighter-rouge">sudo: required</code>.</p>
|
508
|
+
|
509
|
+
<div class="language-yaml highlighter-rouge">
|
510
|
+
<pre class="highlight"><code><span class="s">sudo</span><span class="pi">:</span> <span class="s">false</span>
|
511
|
+
</code></pre>
|
512
|
+
</div>
|
513
|
+
|
514
|
+
<h3 id="troubleshooting">Troubleshooting</h3>
|
515
|
+
|
516
|
+
<p><strong>Travis error:</strong> <em>“You are trying to install in deployment mode after changing
|
517
|
+
your Gemfile. Run bundle install elsewhere and add the updated Gemfile.lock
|
518
|
+
to version control.”</em></p>
|
519
|
+
|
520
|
+
<p><strong>Workaround:</strong> Either run <code class="highlighter-rouge">bundle install</code> locally and commit your changes to
|
521
|
+
<code class="highlighter-rouge">Gemfile.lock</code>, or remove the <code class="highlighter-rouge">Gemfile.lock</code> file from your repository and add
|
522
|
+
an entry in the <code class="highlighter-rouge">.gitignore</code> file to avoid it from being checked in again.</p>
|
523
|
+
|
524
|
+
<h3 id="questions">Questions?</h3>
|
525
|
+
|
526
|
+
<p>This entire guide is open-source. Go ahead and <a href="https://github.com/jekyll/jekyll/edit/master/docs/_docs/continuous-integration/travis-ci.md">edit it</a> if you have a
|
527
|
+
fix or <a href="https://jekyllrb.com/help/">ask for help</a> if you run into trouble and need some help.</p>
|
528
|
+
|
529
|
+
|
530
|
+
|
531
|
+
|
532
|
+
|
533
|
+
|
534
|
+
|
535
|
+
|
536
|
+
|
537
|
+
|
538
|
+
|
539
|
+
|
540
|
+
|
541
|
+
|
542
|
+
|
543
|
+
|
544
|
+
|
545
|
+
|
546
|
+
|
547
|
+
|
548
|
+
|
549
|
+
|
550
|
+
|
551
|
+
|
552
|
+
|
553
|
+
|
554
|
+
|
555
|
+
|
556
|
+
|
557
|
+
|
558
|
+
|
559
|
+
|
560
|
+
|
561
|
+
|
562
|
+
|
563
|
+
|
564
|
+
|
565
|
+
|
566
|
+
|
567
|
+
|
568
|
+
|
569
|
+
|
570
|
+
|
571
|
+
|
572
|
+
|
573
|
+
|
574
|
+
|
575
|
+
|
576
|
+
|
577
|
+
|
578
|
+
|
579
|
+
|
580
|
+
|
581
|
+
|
582
|
+
|
583
|
+
|
584
|
+
|
585
|
+
|
586
|
+
|
587
|
+
|
588
|
+
|
589
|
+
|
590
|
+
|
591
|
+
|
592
|
+
|
593
|
+
|
594
|
+
|
595
|
+
|
596
|
+
|
597
|
+
|
598
|
+
|
599
|
+
|
600
|
+
|
601
|
+
|
602
|
+
|
603
|
+
|
604
|
+
|
605
|
+
|
606
|
+
|
607
|
+
|
608
|
+
|
609
|
+
|
610
|
+
|
611
|
+
|
612
|
+
|
613
|
+
|
614
|
+
|
615
|
+
|
616
|
+
|
617
|
+
|
618
|
+
|
619
|
+
|
620
|
+
|
621
|
+
|
622
|
+
|
623
|
+
|
624
|
+
|
625
|
+
|
626
|
+
|
627
|
+
|
628
|
+
|
629
|
+
|
630
|
+
|
631
|
+
|
632
|
+
|
633
|
+
|
634
|
+
|
635
|
+
|
636
|
+
|
637
|
+
|
638
|
+
|
639
|
+
|
640
|
+
|
641
|
+
</article>
|
642
|
+
</div>
|
643
|
+
|
644
|
+
<div class="unit one-fifth hide-on-mobiles">
|
645
|
+
<aside>
|
646
|
+
|
647
|
+
<h4>Getting Started</h4>
|
648
|
+
<ul>
|
649
|
+
|
650
|
+
|
651
|
+
|
652
|
+
<li class=""><a href="/docs/home/">Welcome</a></li>
|
653
|
+
|
654
|
+
|
655
|
+
|
656
|
+
<li class=""><a href="/docs/quickstart/">Quick-start guide</a></li>
|
657
|
+
|
658
|
+
|
659
|
+
|
660
|
+
<li class=""><a href="/docs/installation/">Installation</a></li>
|
661
|
+
|
662
|
+
|
663
|
+
|
664
|
+
<li class=""><a href="/docs/usage/">Basic Usage</a></li>
|
665
|
+
|
666
|
+
|
667
|
+
|
668
|
+
<li class=""><a href="/docs/structure/">Directory structure</a></li>
|
669
|
+
|
670
|
+
|
671
|
+
|
672
|
+
<li class=""><a href="/docs/configuration/">Configuration</a></li>
|
673
|
+
|
674
|
+
</ul>
|
675
|
+
|
676
|
+
|
677
|
+
<h4>Your Content</h4>
|
678
|
+
<ul>
|
679
|
+
|
680
|
+
|
681
|
+
|
682
|
+
<li class=""><a href="/docs/frontmatter/">Front Matter</a></li>
|
683
|
+
|
684
|
+
|
685
|
+
|
686
|
+
<li class=""><a href="/docs/posts/">Writing posts</a></li>
|
687
|
+
|
688
|
+
|
689
|
+
|
690
|
+
<li class=""><a href="/docs/drafts/">Working with drafts</a></li>
|
691
|
+
|
692
|
+
|
693
|
+
|
694
|
+
<li class=""><a href="/docs/pages/">Creating pages</a></li>
|
695
|
+
|
696
|
+
|
697
|
+
|
698
|
+
<li class=""><a href="/docs/static-files/">Static Files</a></li>
|
699
|
+
|
700
|
+
|
701
|
+
|
702
|
+
<li class=""><a href="/docs/variables/">Variables</a></li>
|
703
|
+
|
704
|
+
|
705
|
+
|
706
|
+
<li class=""><a href="/docs/collections/">Collections</a></li>
|
707
|
+
|
708
|
+
|
709
|
+
|
710
|
+
<li class=""><a href="/docs/datafiles/">Data Files</a></li>
|
711
|
+
|
712
|
+
|
713
|
+
|
714
|
+
<li class=""><a href="/docs/assets/">Assets</a></li>
|
715
|
+
|
716
|
+
|
717
|
+
|
718
|
+
<li class=""><a href="/docs/migrations/">Blog migrations</a></li>
|
719
|
+
|
720
|
+
</ul>
|
721
|
+
|
722
|
+
|
723
|
+
<h4>Customization</h4>
|
724
|
+
<ul>
|
725
|
+
|
726
|
+
|
727
|
+
|
728
|
+
<li class=""><a href="/docs/templates/">Templates</a></li>
|
729
|
+
|
730
|
+
|
731
|
+
|
732
|
+
<li class=""><a href="/docs/includes/">Includes</a></li>
|
733
|
+
|
734
|
+
|
735
|
+
|
736
|
+
<li class=""><a href="/docs/permalinks/">Permalinks</a></li>
|
737
|
+
|
738
|
+
|
739
|
+
|
740
|
+
<li class=""><a href="/docs/pagination/">Pagination</a></li>
|
741
|
+
|
742
|
+
|
743
|
+
|
744
|
+
<li class=""><a href="/docs/plugins/">Plugins</a></li>
|
745
|
+
|
746
|
+
|
747
|
+
|
748
|
+
<li class=""><a href="/docs/themes/">Themes</a></li>
|
749
|
+
|
750
|
+
|
751
|
+
|
752
|
+
<li class=""><a href="/docs/extras/">Extras</a></li>
|
753
|
+
|
754
|
+
</ul>
|
755
|
+
|
756
|
+
|
757
|
+
<h4>Deployment</h4>
|
758
|
+
<ul>
|
759
|
+
|
760
|
+
|
761
|
+
|
762
|
+
<li class=""><a href="/docs/github-pages/">GitHub Pages</a></li>
|
763
|
+
|
764
|
+
|
765
|
+
|
766
|
+
<li class=""><a href="/docs/deployment-methods/">Deployment methods</a></li>
|
767
|
+
|
768
|
+
|
769
|
+
|
770
|
+
<li class=""><a href="/docs/continuous-integration/">Continuous Integration</a></li>
|
771
|
+
|
772
|
+
</ul>
|
773
|
+
|
774
|
+
|
775
|
+
<h4>Miscellaneous</h4>
|
776
|
+
<ul>
|
777
|
+
|
778
|
+
|
779
|
+
|
780
|
+
<li class=""><a href="/docs/troubleshooting/">Troubleshooting</a></li>
|
781
|
+
|
782
|
+
|
783
|
+
|
784
|
+
<li class=""><a href="/docs/sites/">Sites using Jekyll</a></li>
|
785
|
+
|
786
|
+
|
787
|
+
|
788
|
+
<li class=""><a href="/docs/resources/">Resources</a></li>
|
789
|
+
|
790
|
+
|
791
|
+
|
792
|
+
<li class=""><a href="/docs/upgrading/0-to-2/">Upgrading from 0.x to 2.x</a></li>
|
793
|
+
|
794
|
+
|
795
|
+
|
796
|
+
<li class=""><a href="/docs/upgrading/2-to-3/">Upgrading from 2.x to 3.x</a></li>
|
797
|
+
|
798
|
+
</ul>
|
799
|
+
|
800
|
+
|
801
|
+
<h4>Meta</h4>
|
802
|
+
<ul>
|
803
|
+
|
804
|
+
|
805
|
+
|
806
|
+
<li class=""><a href="/docs/contributing/">Contributing</a></li>
|
807
|
+
|
808
|
+
|
809
|
+
|
810
|
+
<li class=""><a href="/docs/maintaining/">Maintaining Jekyll</a></li>
|
811
|
+
|
812
|
+
|
813
|
+
|
814
|
+
<li class=""><a href="/docs/conduct/">Code of Conduct</a></li>
|
815
|
+
|
816
|
+
|
817
|
+
|
818
|
+
<li class=""><a href="/docs/history/">History</a></li>
|
819
|
+
|
820
|
+
</ul>
|
821
|
+
|
822
|
+
|
823
|
+
</aside>
|
824
|
+
</div>
|
825
|
+
|
826
|
+
|
827
|
+
<div class="clear"></div>
|
828
|
+
|
829
|
+
</div>
|
830
|
+
</section>
|
831
|
+
|
832
|
+
|
833
|
+
<footer>
|
834
|
+
<div class="grid">
|
835
|
+
<div class="unit one-third center-on-mobiles">
|
836
|
+
<p>The contents of this website are <br>© 2017 under the terms of the <a href="https://github.com/jekyll/jekyll/blob/master/LICENSE">MIT License</a>.</p>
|
837
|
+
</div>
|
838
|
+
<div class="unit two-thirds align-right center-on-mobiles">
|
839
|
+
<p>
|
840
|
+
Proudly hosted by
|
841
|
+
<a href="https://github.com">
|
842
|
+
<img src="/img/footer-logo.png" width="100" height="30" alt="GitHub • Social coding">
|
843
|
+
</a>
|
844
|
+
</p>
|
845
|
+
</div>
|
846
|
+
</div>
|
847
|
+
</footer>
|
848
|
+
|
849
|
+
<script>
|
850
|
+
var anchorForId = function (id) {
|
851
|
+
var anchor = document.createElement("a");
|
852
|
+
anchor.className = "header-link";
|
853
|
+
anchor.href = "#" + id;
|
854
|
+
anchor.innerHTML = "<span class=\"sr-only\">Permalink</span><i class=\"fa fa-link\"></i>";
|
855
|
+
anchor.title = "Permalink";
|
856
|
+
return anchor;
|
857
|
+
};
|
858
|
+
|
859
|
+
var linkifyAnchors = function (level, containingElement) {
|
860
|
+
var headers = containingElement.getElementsByTagName("h" + level);
|
861
|
+
for (var h = 0; h < headers.length; h++) {
|
862
|
+
var header = headers[h];
|
863
|
+
|
864
|
+
if (typeof header.id !== "undefined" && header.id !== "") {
|
865
|
+
header.appendChild(anchorForId(header.id));
|
866
|
+
}
|
867
|
+
}
|
868
|
+
};
|
869
|
+
|
870
|
+
document.onreadystatechange = function () {
|
871
|
+
if (this.readyState === "complete") {
|
872
|
+
var contentBlock = document.getElementsByClassName("docs")[0] || document.getElementsByClassName("news")[0];
|
873
|
+
if (!contentBlock) {
|
874
|
+
return;
|
875
|
+
}
|
876
|
+
for (var level = 1; level <= 6; level++) {
|
877
|
+
linkifyAnchors(level, contentBlock);
|
878
|
+
}
|
879
|
+
}
|
880
|
+
};
|
881
|
+
</script>
|
882
|
+
|
883
|
+
|
884
|
+
<!-- Gauges (http://get.gaug.es/) -->
|
885
|
+
<script>
|
886
|
+
var _gauges = _gauges || [];
|
887
|
+
(function() {
|
888
|
+
var t = document.createElement('script');
|
889
|
+
t.type = 'text/javascript';
|
890
|
+
t.async = true;
|
891
|
+
t.id = 'gauges-tracker';
|
892
|
+
t.setAttribute('data-site-id', '503c5af6613f5d0f19000027');
|
893
|
+
t.src = '//secure.gaug.es/track.js';
|
894
|
+
var s = document.getElementsByTagName('script')[0];
|
895
|
+
s.parentNode.insertBefore(t, s);
|
896
|
+
})();
|
897
|
+
</script>
|
898
|
+
|
899
|
+
|
900
|
+
|
901
|
+
<!-- Google Analytics (https://www.google.com/analytics) -->
|
902
|
+
<script>
|
903
|
+
!function(j,e,k,y,l,L){j.GoogleAnalyticsObject=y,j[y]||(j[y]=function(){
|
904
|
+
(j[y].q=j[y].q||[]).push(arguments)}),j[y].l=+new Date,l=e.createElement(k),
|
905
|
+
L=e.getElementsByTagName(k)[0],l.src='//www.google-analytics.com/analytics.js',
|
906
|
+
L.parentNode.insertBefore(l,L)}(window,document,'script','ga');
|
907
|
+
|
908
|
+
ga('create', 'UA-50755011-1', 'jekyllrb.com');
|
909
|
+
ga('send', 'pageview');
|
910
|
+
|
911
|
+
</script>
|
912
|
+
|
913
|
+
|
914
|
+
|
915
|
+
</body>
|
916
|
+
</html>
|