update from sparkleup

This commit is contained in:
Madison Scott-Clary 2022-07-25 13:00:16 -07:00
parent 2b6f43871d
commit 2211c823c9
1 changed files with 15 additions and 2 deletions

View File

@ -28,12 +28,13 @@
<li>An Ubuntu 20.04 server configured with a non-root sudo user and firewall by following the <a href="https://www.digitalocean.com/community/tutorials/initial-server-setup-with-ubuntu-20-04">Ubuntu 20.04 initial server setup guide</a>.</li>
<li>Docker installed. You can find out how to do this by following <strong>Steps 1 and 2</strong> of the <a href="https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-20-04">How to Install and Use Docker on Ubuntu 20.04</a> tutuorial.</li>
<li>Docker Compose installed. You can find out how to do this by following <strong>Step 1</strong> of the <a href="https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-compose-on-ubuntu-20-04#step-1-installing-docker-compose">How to Install and Use Docker Compose on 20.04</a> tutorial.</li>
<li></li>
</ul>
</li>
</ul>
<p>Once you have these steps complete, you can continue installing GoCD on your new server.</p>
<h2 id="step-1-installing-gocd">Step 1 — Installing GoCD</h2>
<p>There are several ways to install GoCD. As a Go binary, it is fine to run on its own, but this makes keeping the service up to date more difficult. You can also install it in a Docker container, which is a good way to keep the server containerized if you are running multiple applications on a single server.</p>
<p>There are several ways to install GoCD. As a Java binary, it is fine to run on its own, but this makes keeping the service up to date more difficult. You can also install it in a Docker container, which is a good way to keep the server containerized if you are running multiple applications on a single server.</p>
<p>For the purposes of this tutorial, however, we will be installing the service via the APT repository. This allows easier updates and lets the service run without the overhead of a Docker container.</p>
<h3 id="installing-the-gocd-server">Installing the GoCD server</h3>
<p>To begin, add the APT source to the sources list:</p>
@ -49,12 +50,24 @@
<h3 id="installing-the-gocd-agent">Installing the GoCD Agent</h3>
<p>Every instance of GoCD needs at least one <strong>agent</strong>. Agents are the mechanism by which the server runs pipelines. They spin up an environment in which to execute the commands specified within the pipeline, and once they are finished running those commands, they clean up the environment.</p>
<p>As before, there are several different ways to install agents, each with their own benefits and drawbacks. For instance, installing with Docker will allow multiple agents to be running at a time and is suitable for multiple agents running at the same time. This may be preferable if you foresee running multiple pipelines concurrently. As before, you can also run agents through a Go binary downloaded from the GoCD website.</p>
<p>As before, there are several different ways to install agents, each with their own benefits and drawbacks. For instance, installing with Docker will allow multiple agents to be running at a time and is suitable for multiple agents running at the same time. This may be preferable if you foresee running multiple pipelines concurrently. As before, you can also run agents through a Java binary downloaded from the GoCD website.</p>
<p>Once again, you will be using an agent installed from the APT repository that you set up earlier in this step.</p>
<div class="codehilite"><pre><span></span><code><span class="n">sudo</span><span class="w"> </span><span class="n">apt</span><span class="w"> </span><span class="n">install</span><span class="w"> </span><span class="k">go</span><span class="o">-</span><span class="n">agent</span><span class="w"></span>
</code></pre></div>
<p>This will install the GoCD agent on the server and allow you to run at least one pipeline at a time.</p>
<h3 id="setting-up-your-domain-name-and-https">Setting Up Your Domain Name and HTTPS</h3>
<p>In order to view the GoCD web interface, you will need a domain name pointed at your server as mentioned in the prerequisites. Once you have that DNS record properly in place, you will need to open the firewall ports to allow HTTP(S) connections:</p>
<div class="codehilite"><pre><span></span><code><span class="n">sudo</span><span class="w"> </span><span class="n">ufw</span><span class="w"> </span><span class="n">allow</span><span class="w"> </span>
<span class="n">edit</span><span class="w"> </span><span class="n">a</span><span class="w"> </span><span class="n">configuration</span><span class="w"> </span><span class="k">file</span><span class="w"> </span><span class="n">that</span><span class="w"> </span><span class="n">the</span><span class="w"> </span><span class="n">GoCD</span><span class="w"> </span><span class="n">agent</span><span class="w"> </span><span class="n">has</span><span class="w"> </span><span class="n">installed</span><span class="w"> </span><span class="k">in</span><span class="w"> </span><span class="k">order</span><span class="w"> </span><span class="k">to</span><span class="w"> </span><span class="n">listen</span><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="n">requests</span><span class="w"> </span><span class="k">on</span><span class="w"> </span><span class="n">the</span><span class="w"> </span><span class="n">proper</span><span class="w"> </span><span class="n">address</span><span class="w"> </span><span class="k">and</span><span class="w"> </span><span class="n">ports</span><span class="p">.</span><span class="w"></span>
<span class="k">Open</span><span class="w"> </span><span class="n">the</span><span class="w"> </span><span class="n">configuration</span><span class="w"> </span><span class="k">file</span><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="n">editing</span><span class="p">.</span><span class="w"> </span><span class="n">The</span><span class="w"> </span><span class="k">following</span><span class="w"> </span><span class="n">example</span><span class="w"> </span><span class="n">uses</span><span class="w"> </span><span class="n n-Quoted">`nano`</span><span class="p">.</span><span class="w"> </span><span class="n">This</span><span class="w"> </span><span class="k">file</span><span class="w"> </span><span class="n">will</span><span class="w"> </span><span class="n">contain</span><span class="w"> </span><span class="n">environment</span><span class="w"> </span><span class="k">variables</span><span class="w"> </span><span class="n">that</span><span class="w"> </span><span class="n n-Quoted">`go-server`</span><span class="w"> </span><span class="n">relies</span><span class="w"> </span><span class="k">on</span><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="n">its</span><span class="w"> </span><span class="n">operation</span><span class="o">:</span><span class="w"></span>
<span class="n n-Quoted">`</span><span class="n n-Quoted n-Quoted-Escape">``</span><span class="n n-Quoted">command</span>
<span class="n n-Quoted">nano /usr/share/go-server/wrapper-config/wrapper-properties.conf</span>
</code></pre></div>
<h2 id="step-2-hooking-gocd-up-to-gitea">Step 2 — Hooking GoCD Up to Gitea</h2>
<h2 id="step-3-setting-up-a-pipeline-on-gocd">Step 3 — Setting Up a Pipeline on GoCD</h2>
<h2 id="conclusion">Conclusion</h2>