zk_html/diary/2021-12-05.html

89 lines
5.8 KiB
HTML

<!doctype html>
<html>
<head>
<title>Zk | 2021-12-05</title>
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Gentium+Plus&family=Lato&family=Ubuntu+Monodisplay=swap" />
<link rel="stylesheet" type="text/css" href="/style.css?2024-05-04" />
<meta name="viewport" content="width=device-width" />
<meta charset="utf-8" />
</head>
<body>
<main>
<header>
<h1>Zk | 2021-12-05</h1>
</header>
<article class="content">
<h1 id="back-end-technical-writer-assessment">Back-end technical writer assessment</h1>
<h2 id="proposed-tutorial-series-setting-up-a-web-application-with-cicd-with-gitea-and-drone">Proposed tutorial series: Setting up a web application with CI/CD with Gitea and Drone</h2>
<p>Gitea is a self-hosted git service for managing repositories and users. Drone is a self-hosted continuous integration (CI) service that allows one to automate software build and testing. It works well with Gitea to automate testing, building, and deploying code as it moves through the development life-cycle.</p>
<h3 id="justification">Justification</h3>
<p>By being self-hosted, both Gitea and Drone are attractive options to users with privacy concerns or those who want total control over their CI/CD process, and by being FOSS, it appeals to users who are interested in supporting open source software or who are on a budget &mdash; notably, Gitea is a much lighter-weight option than Gitlab for self-hosted git services and can be run on a small Droplet (it is available as a 1-Click App).</p>
<p>The tutorial series is of medium complexity for someone with dev experience, requiring familiarity with installing software on a Linux server (one must install Docker in order to install Drone), familiarity with the command line (setting up Gitea and Drone require a few commands, and setting up Systemd services a few more), and software such as Nginx and SSH. The strategy for teaching the topic through the tutorial would be to break it up into easily digestible chunks that will offer a chance to play with each of the bits of technology. Additionally, each section of the tutorial will be able to stand alone on its own ( Parts of the tutorial would be expanding on information offered by the installation instructions by Gitea and Drone, but only inasmuch as that&rsquo;s needed for customizing them to the purpose at hand; being able to offer links to to existing resources will help clarify for the developer.</p>
<h3 id="tutorials">Tutorials</h3>
<ol>
<li>
<p>Installing Gitea:</p>
<p>By the end of the tutorial, the user will have an instance of Gitea running on a droplet behind an Nginx reverseproxy. It will be controlled as a Systemd service and ready to use for hosting code. Gitea instance created by this step: <a href="https://gitea.do-assess.makyo.dev/">https://gitea.do-assess.makyo.dev/</a></p>
<ol>
<li>Download Gitea binary and set up system to run it as &lsquo;git&rsquo; user</li>
<li>Set up Nginx reverseproxy to host it</li>
<li>Set up Gitea with Systemd per instructions</li>
<li>Create a repo for your app</li>
</ol>
</li>
<li>
<p>Installing Drone to work with Gitea:</p>
<p>By the end of the tutorial, the user will have an instance of Drone running and connected to Gitea that will be able to build and test applications as the user works on them. Drone instance created by this step: <a href="https://drone.do-assess.makyo.dev">https://drone.do-assess.makyo.dev</a></p>
<ol>
<li>Install docker</li>
<li>Download Drone</li>
<li>Set up Nginx reverseproxy</li>
<li>Integrate Drone and Gitea</li>
<li>Set up project in Drone</li>
</ol>
</li>
<li>
<p>Setting up CI/CD with Drone and Gitea:</p>
<p>By the end of the tutorial, the user will have an application that is continuously tested and deployed to a server to be accessed by the public.</p>
<p>Successful docker runner build: <a href="https://drone.do-assess.makyo.dev/makyo/test-flask/25">https://drone.do-assess.makyo.dev/makyo/test-flask/25</a></p>
<ol>
<li>Set up Drone docker runner for testing</li>
<li>Set up Drone exec runner for deployment</li>
</ol>
</li>
<li>
<p>Setting up deployment strategies with Drone and Gitea:</p>
<p>By the end of the tutorial, the user will have an application set up in three environments &mdash; sandbox, staging, and production &mdash; that are managed through Drone. This will be offered in two very closely paths: using <code>when</code> clauses in the steps to deploy to different environments, and using Drone&rsquo;s concept of promotion to manually promote builds to environments.</p>
<p>Successful deploys at: <a href="https://sandbox.do-assess.makyo.dev">https://sandbox.do-assess.makyo.dev</a> <a href="https://staging.do-assess.makyo.dev">https://staging.do-assess.makyo.dev</a> <a href="https://sandbox.do-assess.makyo.dev">https://sandbox.do-assess.makyo.dev</a></p>
<ol>
<li>Set up pipeline steps for e.g: sandbox, staging, prod</li>
<li>Set up Nginx to serve each target</li>
<li>Using branch limits:<ol>
<li>Merge each branch into main when it lands</li>
<li>Promote sandbox to staging for testing by merging main into staging branch</li>
<li>Promote staging to prod by merging staging into prod</li>
</ol>
</li>
<li>Using promotion:<ol>
<li>Work against e.g: main branch</li>
<li>Promote successful build to desired target using the drone CLI (<code>drone build promote test-flask 25 production</code>)</li>
</ol>
</li>
</ol>
</li>
</ol>
</article>
<footer>
<p>Page generated on 2024-05-04</p>
</footer>
</main>
<script type="text/javascript">
document.querySelectorAll('.tag').forEach(tag => {
let text = tag.innerText;
tag.innerText = '';
tag.innerHTML = `<a href="/tags.html#${text}">${text}</a>`;
});
</script>
</body>
</html>