<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Jason Steinshouer</title>
    <description>The latest articles on DEV Community by Jason Steinshouer (@jsteinshouer).</description>
    <link>https://dev.to/jsteinshouer</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F51688%2F9c8f7b01-0b50-4a89-bd8c-ddad0f4eadfd.jpeg</url>
      <title>DEV Community: Jason Steinshouer</title>
      <link>https://dev.to/jsteinshouer</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/jsteinshouer"/>
    <language>en</language>
    <item>
      <title>Building a CI/CD Workflow for my CFML/Vue.js Application</title>
      <dc:creator>Jason Steinshouer</dc:creator>
      <pubDate>Fri, 03 Dec 2021 04:40:54 +0000</pubDate>
      <link>https://dev.to/jsteinshouer/building-a-cicd-workflow-for-my-cfmlvuejs-application-2c29</link>
      <guid>https://dev.to/jsteinshouer/building-a-cicd-workflow-for-my-cfmlvuejs-application-2c29</guid>
      <description>&lt;h3&gt;
  
  
  My Workflow
&lt;/h3&gt;

&lt;p&gt;The goal of my project was to create a CI/CD workflow for a full-stack application written in CFML (&lt;a href="https://www.lucee.org/"&gt;Lucee&lt;/a&gt;) and Vue.js, running in Docker. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;CI&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Here is a simplified outline of my CI workflow.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Start a database service using the MySQL Docker image&lt;/li&gt;
&lt;li&gt;Build the Docker image for my application&lt;/li&gt;
&lt;li&gt;Run the newly built Docker image and connect it to the MySql database service&lt;/li&gt;
&lt;li&gt;Execute back-end API integration testing using &lt;a href="https://www.ortussolutions.com/products/testbox"&gt;Testbox&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Execute &lt;a href="https://www.cypress.io/"&gt;Cypress&lt;/a&gt; front-end and end-to-end tests&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;CD&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;My deployment process is triggered when a Github release is created using a &lt;a href="https://semver.org/"&gt;semver&lt;/a&gt; tag. Here is the general outline.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Build a multi-platform Docker image. (I am utilizing the free trial of t4g.micro AWS EC2 instance so I need to run it on ARM64 architecture.)&lt;/li&gt;
&lt;li&gt;Push the image to Dockerhub using a semver tag.&lt;/li&gt;
&lt;li&gt;Connect to the server and trigger a Docker service update to pull down the new image and start it up.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Github Actions I am using&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Since my application is running with Docker I am utilizing several Actions from Docker. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://github.com/docker/setup-buildx-action"&gt;docker/setup-buildx-action&lt;/a&gt; (Buildx allows for building multi-platform images)&lt;/li&gt;
&lt;li&gt;actions/cache (With buildx I can use Docker layer caching to speed up subsequent builds)&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/docker/build-push-action"&gt;docker/build-push-action&lt;/a&gt; (This action builds the images and optionally pushes them to a repository)&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/docker/setup-qemu-action"&gt;docker/setup-qemu-action&lt;/a&gt; (This is needed for building images for other platforms)&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/docker/login-action"&gt;docker/login-action&lt;/a&gt; (Login to Dockerhub so it can push the image)&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Submission Category:
&lt;/h3&gt;

&lt;p&gt;DIY Deployments&lt;/p&gt;

&lt;h3&gt;
  
  
  Yaml File or Link to Code
&lt;/h3&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--566lAguM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/github-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/jsteinshouer"&gt;
        jsteinshouer
      &lt;/a&gt; / &lt;a href="https://github.com/jsteinshouer/movie-list-app"&gt;
        movie-list-app
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;h1&gt;
My Movie App&lt;/h1&gt;
&lt;h2&gt;
Getting Started&lt;/h2&gt;
&lt;h3&gt;
Docker secrets&lt;/h3&gt;
&lt;p&gt;For development generate the secrets that docker-compose will use to to pass database credentails for our development environment.&lt;/p&gt;
&lt;div class="snippet-clipboard-content position-relative overflow-auto"&gt;&lt;pre&gt;&lt;code&gt;mkdir secrets
openssl rand 20 | base64 -w 0 &amp;gt; ./secrets/MYSQL_ROOT_PASSWORD
openssl rand 20 | base64 -w 0 &amp;gt; ./secrets/MYSQL_PASSWORD
openssl rand 32 | base64 -w 0 | docker secret create JWT_SECRET -
echo "mydbuser" &amp;gt; ./secrets/MYSQL_USER
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h3&gt;
Environment variables&lt;/h3&gt;
&lt;p&gt;Create a &lt;code&gt;.env&lt;/code&gt; file for your envrionment.&lt;/p&gt;
&lt;div class="snippet-clipboard-content position-relative overflow-auto"&gt;&lt;pre&gt;&lt;code&gt;cp .env.example .env
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h3&gt;
OMDB API&lt;/h3&gt;
&lt;p&gt;This application uses the Open Movie Database API. You can register for a free API key at &lt;a href="https://www.omdbapi.com/" rel="nofollow"&gt;https://www.omdbapi.com/&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Set &lt;code&gt;OMDB_API_KEY=&amp;lt;yourkeyhere&amp;gt;&lt;/code&gt; in the .env file.&lt;/p&gt;
&lt;h3&gt;
Run the application using Docker Compose.&lt;/h3&gt;
&lt;div class="snippet-clipboard-content position-relative overflow-auto"&gt;&lt;pre&gt;&lt;code&gt;docker compose up
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h3&gt;
VS Code - Remote Container&lt;/h3&gt;
&lt;p&gt;You can also run the application using the VS code remote container extension.&lt;/p&gt;
&lt;h2&gt;
Run the tests&lt;/h2&gt;
&lt;h3&gt;
Coldbox API Tests&lt;/h3&gt;
&lt;p&gt;You can execute the API tests in the terminal using this command.&lt;/p&gt;
&lt;div class="snippet-clipboard-content position-relative overflow-auto"&gt;
&lt;pre&gt;&lt;code&gt;docker exec -it movie-app-api&lt;/code&gt;&lt;/pre&gt;…&lt;/div&gt;
&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/jsteinshouer/movie-list-app"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;CI - &lt;a href="https://github.com/jsteinshouer/movie-list-app/blob/main/.github/workflows/main.yml"&gt;main.yml&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;CD - &lt;a href="https://github.com/jsteinshouer/movie-list-app/blob/main/.github/workflows/release.yml"&gt;release.yml&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Additional Resources / Info
&lt;/h3&gt;

&lt;p&gt;Here are a few of the resources I used for setting up my workflows.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/metcalfc/docker-action-examples"&gt;https://github.com/metcalfc/docker-action-examples&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/BretFisher"&gt;https://github.com/BretFisher&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/Ortus-Solutions/docker-commandbox"&gt;https://github.com/Ortus-Solutions/docker-commandbox&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>actionshackathon21</category>
      <category>github</category>
      <category>opensource</category>
    </item>
  </channel>
</rss>
