Skip to content

Commit 6b66410

Browse files
committed
Rebuild iko docs
1 parent 78790c0 commit 6b66410

File tree

4 files changed

+36
-37
lines changed

4 files changed

+36
-37
lines changed

iko/commands/index.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1025,11 +1025,17 @@
10251025

10261026

10271027
<h1 id="commands">Commands</h1>
1028+
<p>Iko provides a command-line interface for generating and managing Sqitch-based
1029+
migrations.</p>
1030+
<p>This page is a reference for all available commands.</p>
10281031
<h2 id="sqitch-commands">Sqitch commands</h2>
10291032
<p>Iko aliases all of <a href="https://sqitch.org/docs/manual/">Sqitch's commands</a>.</p>
1033+
<p>For example, <code>sqitch check</code> becomes <code>iko check</code>.</p>
10301034
<p>You can also access <code>sqitch</code> directly, for example:</p>
10311035
<div class="highlight"><pre><span></span><code>iko<span class="w"> </span>sqitch<span class="w"> </span>--version
10321036
</code></pre></div>
1037+
<p>When scripting, the <code>iko</code> part is left out. For example, <code>iko create_schema api</code> becomes simply <code>create_schema api</code>. In this document the <code>iko</code> command is
1038+
left out.</p>
10331039
<h2 id="ad-hoc-migrations">Ad-hoc migrations</h2>
10341040
<blockquote>
10351041
<p>📖 Refer to <a href="https://sqitch.org/docs/manual/sqitch-add/">sqitch-add</a>.</p>

iko/deploying/index.html

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -628,18 +628,21 @@
628628

629629
<h1 id="deploying-migrations-to-remote-environments">🚀 Deploying Migrations to Remote Environments</h1>
630630
<p>Iko runs inside a container, so to deploy migrations to a remote environment
631-
(like staging or production), you’ll need to include your migration scripts
632-
inside a custom Docker image.</p>
631+
(like staging or production), build a custom Docker image containing your
632+
migration scripts.</p>
633633
<p>This guide explains how to build and use that image.</p>
634634
<hr />
635635
<h2 id="why-use-a-custom-image">✅ Why use a custom image?</h2>
636-
<p>The standard Iko CLI uses <code>docker run</code> with a local <code>migrations/</code> directory mounted into the container. This works great locally, but in remote environments:</p>
636+
<p>The standard Iko CLI uses <code>docker run</code> with a local <code>migrations/</code> directory
637+
mounted into the container. This works great locally, but in remote
638+
environments:</p>
637639
<ul>
638640
<li>There's no local <code>migrations/</code> directory to mount.</li>
639641
<li>There’s no Git repository cloned.</li>
640642
<li>You want repeatable, portable deploys — not manual file copying.</li>
641643
</ul>
642-
<p>By building a Docker image that <em>includes</em> your migrations, you ensure the container is fully self-contained and deployable anywhere.</p>
644+
<p>By building a Docker image that <em>includes</em> your migrations, you ensure the
645+
container is fully self-contained and deployable anywhere.</p>
643646
<hr />
644647
<h2 id="step-by-step-build-and-deploy">🧱 Step-by-Step: Build and Deploy</h2>
645648
<h3 id="1-create-a-dockerfile">1. Create a Dockerfile</h3>
@@ -650,10 +653,10 @@ <h3 id="1-create-a-dockerfile">1. Create a Dockerfile</h3>
650653
<p>This copies your migrations into the image at /repo, where Iko expects them.</p>
651654
<h3 id="2-build-the-image">2. Build the image</h3>
652655
<p>Give it a meaningful tag, e.g. for production:</p>
653-
<div class="highlight"><pre><span></span><code>docker<span class="w"> </span>build<span class="w"> </span>-t<span class="w"> </span>ghcr.io/your-org/iko-with-migrations:latest<span class="w"> </span>.
656+
<div class="highlight"><pre><span></span><code>docker<span class="w"> </span>build<span class="w"> </span>-t<span class="w"> </span>ghcr.io/&lt;org&gt;/iko-&lt;project&gt;:latest<span class="w"> </span>.
654657
</code></pre></div>
655658
<p>Then push it to your container registry:</p>
656-
<div class="highlight"><pre><span></span><code>docker<span class="w"> </span>push<span class="w"> </span>ghcr.io/your-org/iko-with-migrations:latest
659+
<div class="highlight"><pre><span></span><code>docker<span class="w"> </span>push<span class="w"> </span>ghcr.io/your-org/iko-&lt;project&gt;:latest
657660
</code></pre></div>
658661
<h3 id="3-set-the-target-connection">3. Set the target connection</h3>
659662
<p>Iko uses the <code>SQITCH_TARGET</code> environment variable to connect to your database.</p>
@@ -667,15 +670,14 @@ <h3 id="3-set-the-target-connection">3. Set the target connection</h3>
667670
</blockquote>
668671
<h3 id="4-run-the-deployment">4. Run the deployment</h3>
669672
<p>From your CI/CD pipeline or target server, run:</p>
670-
<div class="highlight"><pre><span></span><code>docker<span class="w"> </span>run<span class="w"> </span>--rm<span class="w"> </span><span class="se">\</span>
671-
<span class="w"> </span>ghcr.io/your-org/iko-with-migrations:latest<span class="w"> </span>deploy<span class="w"> </span>--verify
673+
<div class="highlight"><pre><span></span><code>docker<span class="w"> </span>run<span class="w"> </span>--rm<span class="w"> </span>ghcr.io/your-org/iko-your-project:latest<span class="w"> </span>deploy<span class="w"> </span>--verify
672674
</code></pre></div>
673675
<h4 id="do-i-need-network">🤔 Do I need --network?</h4>
674676
<p>Only if your Postgres instance is running in Docker on the same machine.</p>
675677
<p>If so, and it's in a custom Docker network, use:</p>
676678
<div class="highlight"><pre><span></span><code>docker<span class="w"> </span>run<span class="w"> </span>--rm<span class="w"> </span><span class="se">\</span>
677679
<span class="w"> </span>--network<span class="w"> </span>your-network<span class="w"> </span><span class="se">\</span>
678-
<span class="w"> </span>ghcr.io/your-org/iko-with-migrations:latest<span class="w"> </span>deploy<span class="w"> </span>--verify
680+
<span class="w"> </span>ghcr.io/your-org/iko-your-project:latest<span class="w"> </span>deploy<span class="w"> </span>--verify
679681
</code></pre></div>
680682
<p>Otherwise, for hosted databases (RDS, Cloud SQL, etc.) or Postgres installed on
681683
the host system, you don’t need a custom Docker network.</p>

0 commit comments

Comments
 (0)