site/docs/deployment-methods/index.html in jekyll-docs-3.2.1 vs site/docs/deployment-methods/index.html in jekyll-docs-3.3.0

- old
+ new

@@ -2,11 +2,11 @@ <html lang="en-US"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width,initial-scale=1"> - <meta name="generator" content="Jekyll v3.2.1"> + <meta name="generator" content="Jekyll v3.3.0"> <link type="application/atom+xml" rel="alternate" href="https://jekyllrb.com/feed.xml" title="Jekyll • Simple, blog-aware, static sites"> <link rel="alternate" type="application/atom+xml" title="Recent commits to Jekyll’s master branch" href="https://github.com/jekyll/jekyll/commits/master.atom"> <link rel="stylesheet" href="//fonts.googleapis.com/css?family=Lato:300,300italic,400,400italic,700,700italic,900"> <link rel="stylesheet" href="/css/screen.css"> <link rel="icon" type="image/x-icon" href="/favicon.ico"> @@ -17,22 +17,22 @@ <meta property="og:description" content="Sites built using Jekyll can be deployed in a large number of ways due to the static nature of the generated output. A few of the most common deployment techniques are described below."> <link rel="canonical" href="https://jekyllrb.com/docs/deployment-methods/"> <meta property="og:url" content="https://jekyllrb.com/docs/deployment-methods/"> <meta property="og:site_name" content="Jekyll • Simple, blog-aware, static sites"> <meta property="og:type" content="article"> -<meta property="article:published_time" content="2016-08-02T18:14:35-07:00"> +<meta property="article:published_time" content="2016-10-06T11:16:34-07:00"> <meta name="twitter:card" content="summary"> <meta name="twitter:site" content="@jekyllrb"> <meta name="google-site-verification" content="onQcXpAvtHBrUI5LlroHNE_FP0b2qvFyPq7VZw36iEY"> <script type="application/ld+json"> { "@context": "http://schema.org", "@type": "BlogPosting", "headline": "Deployment methods", - "datePublished": "2016-08-02T18:14:35-07:00", + "datePublished": "2016-10-06T11:16:34-07:00", "description": "Sites built using Jekyll can be deployed in a large number of ways due to the static nature of the generated output. A few of the most common deployment techniques are described below.", - "logo": "https://jekyllrb.comimg/logo-2x.png", + "logo": "https://jekyllrb.com/img/logo-2x.png", "url": "https://jekyllrb.com/docs/deployment-methods/" } </script> <!-- End Jekyll SEO tag --> <!--[if lt IE 9]> @@ -112,164 +112,164 @@ <optgroup label="Getting Started"> - <option value="https://jekyllrb.com/docs/home/">Welcome</option> + <option value="/docs/home/">Welcome</option> - <option value="https://jekyllrb.com/docs/quickstart/">Quick-start guide</option> + <option value="/docs/quickstart/">Quick-start guide</option> - <option value="https://jekyllrb.com/docs/installation/">Installation</option> + <option value="/docs/installation/">Installation</option> - <option value="https://jekyllrb.com/docs/usage/">Basic Usage</option> + <option value="/docs/usage/">Basic Usage</option> - <option value="https://jekyllrb.com/docs/structure/">Directory structure</option> + <option value="/docs/structure/">Directory structure</option> - <option value="https://jekyllrb.com/docs/configuration/">Configuration</option> + <option value="/docs/configuration/">Configuration</option> </optgroup> <optgroup label="Your Content"> - <option value="https://jekyllrb.com/docs/frontmatter/">Front Matter</option> + <option value="/docs/frontmatter/">Front Matter</option> - <option value="https://jekyllrb.com/docs/posts/">Writing posts</option> + <option value="/docs/posts/">Writing posts</option> - <option value="https://jekyllrb.com/docs/drafts/">Working with drafts</option> + <option value="/docs/drafts/">Working with drafts</option> - <option value="https://jekyllrb.com/docs/pages/">Creating pages</option> + <option value="/docs/pages/">Creating pages</option> - <option value="https://jekyllrb.com/docs/static-files/">Static Files</option> + <option value="/docs/static-files/">Static Files</option> - <option value="https://jekyllrb.com/docs/variables/">Variables</option> + <option value="/docs/variables/">Variables</option> - <option value="https://jekyllrb.com/docs/collections/">Collections</option> + <option value="/docs/collections/">Collections</option> - <option value="https://jekyllrb.com/docs/datafiles/">Data Files</option> + <option value="/docs/datafiles/">Data Files</option> - <option value="https://jekyllrb.com/docs/assets/">Assets</option> + <option value="/docs/assets/">Assets</option> - <option value="https://jekyllrb.com/docs/migrations/">Blog migrations</option> + <option value="/docs/migrations/">Blog migrations</option> </optgroup> <optgroup label="Customization"> - <option value="https://jekyllrb.com/docs/templates/">Templates</option> + <option value="/docs/templates/">Templates</option> - <option value="https://jekyllrb.com/docs/permalinks/">Permalinks</option> + <option value="/docs/permalinks/">Permalinks</option> - <option value="https://jekyllrb.com/docs/pagination/">Pagination</option> + <option value="/docs/pagination/">Pagination</option> - <option value="https://jekyllrb.com/docs/plugins/">Plugins</option> + <option value="/docs/plugins/">Plugins</option> - <option value="https://jekyllrb.com/docs/themes/">Themes</option> + <option value="/docs/themes/">Themes</option> - <option value="https://jekyllrb.com/docs/extras/">Extras</option> + <option value="/docs/extras/">Extras</option> </optgroup> <optgroup label="Deployment"> - <option value="https://jekyllrb.com/docs/github-pages/">GitHub Pages</option> + <option value="/docs/github-pages/">GitHub Pages</option> - <option value="https://jekyllrb.com/docs/deployment-methods/">Deployment methods</option> + <option value="/docs/deployment-methods/">Deployment methods</option> - <option value="https://jekyllrb.com/docs/continuous-integration/">Continuous Integration</option> + <option value="/docs/continuous-integration/">Continuous Integration</option> </optgroup> <optgroup label="Miscellaneous"> - <option value="https://jekyllrb.com/docs/troubleshooting/">Troubleshooting</option> + <option value="/docs/troubleshooting/">Troubleshooting</option> - <option value="https://jekyllrb.com/docs/sites/">Sites using Jekyll</option> + <option value="/docs/sites/">Sites using Jekyll</option> - <option value="https://jekyllrb.com/docs/resources/">Resources</option> + <option value="/docs/resources/">Resources</option> - <option value="https://jekyllrb.com/docs/upgrading/0-to-2/">Upgrading from 0.x to 2.x</option> + <option value="/docs/upgrading/0-to-2/">Upgrading from 0.x to 2.x</option> - <option value="https://jekyllrb.com/docs/upgrading/2-to-3/">Upgrading from 2.x to 3.x</option> + <option value="/docs/upgrading/2-to-3/">Upgrading from 2.x to 3.x</option> </optgroup> <optgroup label="Meta"> - <option value="https://jekyllrb.com/docs/contributing/">Contributing</option> + <option value="/docs/contributing/">Contributing</option> - <option value="https://jekyllrb.com/docs/conduct/">Code of Conduct</option> + <option value="/docs/conduct/">Code of Conduct</option> - <option value="https://jekyllrb.com/docs/history/">History</option> + <option value="/docs/history/">History</option> </optgroup> </select> @@ -284,11 +284,11 @@ <h1>Deployment methods</h1> <p>Sites built using Jekyll can be deployed in a large number of ways due to the static nature of the generated output. A few of the most common deployment techniques are described below.</p> <h2 id="web-hosting-providers-ftp">Web hosting providers (FTP)</h2> -<p>Just about any traditional web hosting provider will let you upload files to their servers over FTP. To upload a Jekyll site to a web host using FTP, simply run the <code class="highlighter-rouge">jekyll</code> command and copy the generated <code class="highlighter-rouge">_site</code> folder to the root folder of your hosting account. This is most likely to be the <code class="highlighter-rouge">httpdocs</code> or <code class="highlighter-rouge">public_html</code> folder on most hosting providers.</p> +<p>Just about any traditional web hosting provider will let you upload files to their servers over FTP. To upload a Jekyll site to a web host using FTP, simply run the <code class="highlighter-rouge">jekyll build</code> command and copy the generated <code class="highlighter-rouge">_site</code> folder to the root folder of your hosting account. This is most likely to be the <code class="highlighter-rouge">httpdocs</code> or <code class="highlighter-rouge">public_html</code> folder on most hosting providers.</p> <h3 id="ftp-using-glynn">FTP using Glynn</h3> <p>There is a project called <a href="https://github.com/dmathieu/glynn">Glynn</a>, which lets you easily generate your Jekyll powered website’s static files and send them to your host through FTP.</p> @@ -311,38 +311,50 @@ <h3 id="git-post-receive-hook">Git post-receive hook</h3> <p>To have a remote server handle the deploy for you every time you push changes using Git, you can create a user account which has all the public keys that are authorized to deploy in its <code class="highlighter-rouge">authorized_keys</code> file. With that in place, setting up the post-receive hook is done as follows:</p> -<figure class="highlight"><pre><code class="language-shell" data-lang="shell"><span class="gp">laptop$ </span>ssh deployer@example.com +<div class="language-sh highlighter-rouge"> +<pre class="highlight"><code><span class="gp">laptop$ </span>ssh deployer@example.com <span class="gp">server$ </span>mkdir myrepo.git <span class="gp">server$ </span><span class="nb">cd </span>myrepo.git <span class="gp">server$ </span>git --bare init <span class="gp">server$ </span>cp hooks/post-receive.sample hooks/post-receive -<span class="gp">server$ </span>mkdir /var/www/myrepo</code></pre></figure> +<span class="gp">server$ </span>mkdir /var/www/myrepo +</code></pre> +</div> <p>Next, add the following lines to hooks/post-receive and be sure Jekyll is installed on the server:</p> -<figure class="highlight"><pre><code class="language-shell" data-lang="shell"><span class="nv">GIT_REPO</span><span class="o">=</span><span class="nv">$HOME</span>/myrepo.git +<div class="language-sh highlighter-rouge"> +<pre class="highlight"><code><span class="nv">GIT_REPO</span><span class="o">=</span><span class="nv">$HOME</span>/myrepo.git <span class="nv">TMP_GIT_CLONE</span><span class="o">=</span><span class="nv">$HOME</span>/tmp/myrepo <span class="nv">PUBLIC_WWW</span><span class="o">=</span>/var/www/myrepo git clone <span class="nv">$GIT_REPO</span> <span class="nv">$TMP_GIT_CLONE</span> jekyll build -s <span class="nv">$TMP_GIT_CLONE</span> -d <span class="nv">$PUBLIC_WWW</span> rm -Rf <span class="nv">$TMP_GIT_CLONE</span> -<span class="nb">exit</span></code></pre></figure> +<span class="nb">exit</span> +</code></pre> +</div> <p>Finally, run the following command on any users laptop that needs to be able to deploy using this hook:</p> -<figure class="highlight"><pre><code class="language-shell" data-lang="shell"><span class="gp">laptops$ </span>git remote add deploy deployer@example.com:~/myrepo.git</code></pre></figure> +<div class="language-sh highlighter-rouge"> +<pre class="highlight"><code><span class="gp">laptops$ </span>git remote add deploy deployer@example.com:~/myrepo.git +</code></pre> +</div> <p>Deploying is now as easy as telling nginx or Apache to look at <code class="highlighter-rouge">/var/www/myrepo</code> and running the following:</p> -<figure class="highlight"><pre><code class="language-shell" data-lang="shell"><span class="gp">laptops$ </span>git push deploy master</code></pre></figure> +<div class="language-sh highlighter-rouge"> +<pre class="highlight"><code><span class="gp">laptops$ </span>git push deploy master +</code></pre> +</div> <h3 id="jekyll-hook">Jekyll-hook</h3> <p>You can also use jekyll-hook, a server that listens for webhook posts from GitHub, generates a website with Jekyll, and moves it somewhere to be @@ -394,21 +406,27 @@ described in several places online. What is different from the typical approach is to put the restriction to certificate-based authorization in <code class="highlighter-rouge">~/.ssh/authorized_keys</code>. Then, launch <code class="highlighter-rouge">rrsync</code> and supply it with the folder it shall have read-write access to:</p> -<figure class="highlight"><pre><code class="language-shell" data-lang="shell"><span class="nb">command</span><span class="o">=</span><span class="s2">"</span><span class="nv">$HOME</span><span class="s2">/bin/rrsync &lt;folder&gt;"</span>,no-agent-forwarding,no-port-forwarding,no-pty,no-user-rc,no-X11-forwarding ssh-rsa &lt;cert&gt;</code></pre></figure> +<div class="language-sh highlighter-rouge"> +<pre class="highlight"><code><span class="nb">command</span><span class="o">=</span><span class="s2">"</span><span class="nv">$HOME</span><span class="s2">/bin/rrsync &lt;folder&gt;"</span>,no-agent-forwarding,no-port-forwarding,no-pty,no-user-rc,no-X11-forwarding ssh-rsa &lt;cert&gt; +</code></pre> +</div> <p><code class="highlighter-rouge">&lt;folder&gt;</code> is the path to your site. E.g., <code class="highlighter-rouge">~/public_html/you.org/blog-html/</code>.</p> <h4 id="step-3-rsync-client-side">Step 3: Rsync (client-side)</h4> <p>Add the <code class="highlighter-rouge">deploy</code> script to the site source folder:</p> -<figure class="highlight"><pre><code class="language-shell" data-lang="shell"><span class="c">#!/bin/sh</span> +<div class="language-sh highlighter-rouge"> +<pre class="highlight"><code><span class="c">#!/bin/sh</span> -rsync -crvz --rsh<span class="o">=</span><span class="s1">'ssh -p2222'</span> --delete-after --delete-excluded &lt;folder&gt; &lt;user&gt;@&lt;site&gt;:</code></pre></figure> +rsync -crvz --rsh<span class="o">=</span><span class="s1">'ssh -p2222'</span> --delete-after --delete-excluded &lt;folder&gt; &lt;user&gt;@&lt;site&gt;: +</code></pre> +</div> <p>Command line parameters are:</p> <ul> <li> @@ -422,11 +440,14 @@ <code class="highlighter-rouge">&lt;site&gt;</code> — Your hosting server</li> </ul> <p>Using this setup, you might run the following command:</p> -<figure class="highlight"><pre><code class="language-shell" data-lang="shell">rsync -crvz --rsh<span class="o">=</span><span class="s1">'ssh -p2222'</span> --delete-after --delete-excluded _site/ hostuser@example.org:</code></pre></figure> +<div class="language-sh highlighter-rouge"> +<pre class="highlight"><code>rsync -crvz --rsh<span class="o">=</span><span class="s1">'ssh -p2222'</span> --delete-after --delete-excluded _site/ hostuser@example.org: +</code></pre> +</div> <p>Don’t forget the column <code class="highlighter-rouge">:</code> after server name!</p> <h4 id="step-4-optional-exclude-the-transfer-script-from-being-copied-to-the-output-folder">Step 4 (Optional): Exclude the transfer script from being copied to the output folder.</h4> @@ -434,12 +455,15 @@ you put the <code class="highlighter-rouge">deploy</code> script in the root folder of your project, Jekyll will copy it to the output folder. This behavior can be changed in <code class="highlighter-rouge">_config.yml</code>.</p> <p>Just add the following line:</p> -<figure class="highlight"><pre><code class="language-yaml" data-lang="yaml"><span class="c1"># Do not copy these files to the output directory</span> -<span class="s">exclude</span><span class="pi">:</span> <span class="pi">[</span><span class="s2">"</span><span class="s">deploy"</span><span class="pi">]</span></code></pre></figure> +<div class="language-yaml highlighter-rouge"> +<pre class="highlight"><code><span class="c1"># Do not copy these files to the output directory</span> +<span class="s">exclude</span><span class="pi">:</span> <span class="pi">[</span><span class="s2">"</span><span class="s">deploy"</span><span class="pi">]</span> +</code></pre> +</div> <p>Alternatively, you can use an <code class="highlighter-rouge">rsync-exclude.txt</code> file to control which files will be transferred to your server.</p> <h4 id="done">Done!</h4> @@ -467,11 +491,11 @@ benefit of being about the cheapest hosting option available for low-volume blogs as you only pay for what you use.</p> <h2 id="openshift">OpenShift</h2> -<p>If you’d like to deploy your site to an OpenShift gear, there’s <a href="https://github.com/openshift-cartridges/openshift-jekyll-cartridge">a cartridge +<p>If you’d like to deploy your site to an OpenShift gear, there’s <a href="https://github.com/openshift-quickstart/jekyll-openshift">a cartridge for that</a>.</p> <div class="note"> <h5>ProTip™: Use GitHub Pages for zero-hassle Jekyll hosting</h5> <p>GitHub Pages are powered by Jekyll behind the scenes, so if you’re looking for a zero-hassle, zero-cost solution, GitHub Pages are a great way to <a href="../github-pages/">host your Jekyll-powered website for free</a>.</p> @@ -605,168 +629,168 @@ <h4>Getting Started</h4> <ul> - <li class=""><a href="https://jekyllrb.com/docs/home/">Welcome</a></li> + <li class=""><a href="/docs/home/">Welcome</a></li> - <li class=""><a href="https://jekyllrb.com/docs/quickstart/">Quick-start guide</a></li> + <li class=""><a href="/docs/quickstart/">Quick-start guide</a></li> - <li class=""><a href="https://jekyllrb.com/docs/installation/">Installation</a></li> + <li class=""><a href="/docs/installation/">Installation</a></li> - <li class=""><a href="https://jekyllrb.com/docs/usage/">Basic Usage</a></li> + <li class=""><a href="/docs/usage/">Basic Usage</a></li> - <li class=""><a href="https://jekyllrb.com/docs/structure/">Directory structure</a></li> + <li class=""><a href="/docs/structure/">Directory structure</a></li> - <li class=""><a href="https://jekyllrb.com/docs/configuration/">Configuration</a></li> + <li class=""><a href="/docs/configuration/">Configuration</a></li> </ul> <h4>Your Content</h4> <ul> - <li class=""><a href="https://jekyllrb.com/docs/frontmatter/">Front Matter</a></li> + <li class=""><a href="/docs/frontmatter/">Front Matter</a></li> - <li class=""><a href="https://jekyllrb.com/docs/posts/">Writing posts</a></li> + <li class=""><a href="/docs/posts/">Writing posts</a></li> - <li class=""><a href="https://jekyllrb.com/docs/drafts/">Working with drafts</a></li> + <li class=""><a href="/docs/drafts/">Working with drafts</a></li> - <li class=""><a href="https://jekyllrb.com/docs/pages/">Creating pages</a></li> + <li class=""><a href="/docs/pages/">Creating pages</a></li> - <li class=""><a href="https://jekyllrb.com/docs/static-files/">Static Files</a></li> + <li class=""><a href="/docs/static-files/">Static Files</a></li> - <li class=""><a href="https://jekyllrb.com/docs/variables/">Variables</a></li> + <li class=""><a href="/docs/variables/">Variables</a></li> - <li class=""><a href="https://jekyllrb.com/docs/collections/">Collections</a></li> + <li class=""><a href="/docs/collections/">Collections</a></li> - <li class=""><a href="https://jekyllrb.com/docs/datafiles/">Data Files</a></li> + <li class=""><a href="/docs/datafiles/">Data Files</a></li> - <li class=""><a href="https://jekyllrb.com/docs/assets/">Assets</a></li> + <li class=""><a href="/docs/assets/">Assets</a></li> - <li class=""><a href="https://jekyllrb.com/docs/migrations/">Blog migrations</a></li> + <li class=""><a href="/docs/migrations/">Blog migrations</a></li> </ul> <h4>Customization</h4> <ul> - <li class=""><a href="https://jekyllrb.com/docs/templates/">Templates</a></li> + <li class=""><a href="/docs/templates/">Templates</a></li> - <li class=""><a href="https://jekyllrb.com/docs/permalinks/">Permalinks</a></li> + <li class=""><a href="/docs/permalinks/">Permalinks</a></li> - <li class=""><a href="https://jekyllrb.com/docs/pagination/">Pagination</a></li> + <li class=""><a href="/docs/pagination/">Pagination</a></li> - <li class=""><a href="https://jekyllrb.com/docs/plugins/">Plugins</a></li> + <li class=""><a href="/docs/plugins/">Plugins</a></li> - <li class=""><a href="https://jekyllrb.com/docs/themes/">Themes</a></li> + <li class=""><a href="/docs/themes/">Themes</a></li> - <li class=""><a href="https://jekyllrb.com/docs/extras/">Extras</a></li> + <li class=""><a href="/docs/extras/">Extras</a></li> </ul> <h4>Deployment</h4> <ul> - <li class=""><a href="https://jekyllrb.com/docs/github-pages/">GitHub Pages</a></li> + <li class=""><a href="/docs/github-pages/">GitHub Pages</a></li> - <li class="current"><a href="https://jekyllrb.com/docs/deployment-methods/">Deployment methods</a></li> + <li class="current"><a href="/docs/deployment-methods/">Deployment methods</a></li> - <li class=""><a href="https://jekyllrb.com/docs/continuous-integration/">Continuous Integration</a></li> + <li class=""><a href="/docs/continuous-integration/">Continuous Integration</a></li> </ul> <h4>Miscellaneous</h4> <ul> - <li class=""><a href="https://jekyllrb.com/docs/troubleshooting/">Troubleshooting</a></li> + <li class=""><a href="/docs/troubleshooting/">Troubleshooting</a></li> - <li class=""><a href="https://jekyllrb.com/docs/sites/">Sites using Jekyll</a></li> + <li class=""><a href="/docs/sites/">Sites using Jekyll</a></li> - <li class=""><a href="https://jekyllrb.com/docs/resources/">Resources</a></li> + <li class=""><a href="/docs/resources/">Resources</a></li> - <li class=""><a href="https://jekyllrb.com/docs/upgrading/0-to-2/">Upgrading from 0.x to 2.x</a></li> + <li class=""><a href="/docs/upgrading/0-to-2/">Upgrading from 0.x to 2.x</a></li> - <li class=""><a href="https://jekyllrb.com/docs/upgrading/2-to-3/">Upgrading from 2.x to 3.x</a></li> + <li class=""><a href="/docs/upgrading/2-to-3/">Upgrading from 2.x to 3.x</a></li> </ul> <h4>Meta</h4> <ul> - <li class=""><a href="https://jekyllrb.com/docs/contributing/">Contributing</a></li> + <li class=""><a href="/docs/contributing/">Contributing</a></li> - <li class=""><a href="https://jekyllrb.com/docs/conduct/">Code of Conduct</a></li> + <li class=""><a href="/docs/conduct/">Code of Conduct</a></li> - <li class=""><a href="https://jekyllrb.com/docs/history/">History</a></li> + <li class=""><a href="/docs/history/">History</a></li> </ul> </aside>