<?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: Kenneth Atria</title>
    <description>The latest articles on DEV Community by Kenneth Atria (@kennethatria).</description>
    <link>https://dev.to/kennethatria</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%2F654546%2F1a2e69c0-44e8-4691-9119-8ad0c58680f5.jpg</url>
      <title>DEV Community: Kenneth Atria</title>
      <link>https://dev.to/kennethatria</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/kennethatria"/>
    <language>en</language>
    <item>
      <title>Git practices with Git flow and semantic-versioning</title>
      <dc:creator>Kenneth Atria</dc:creator>
      <pubDate>Tue, 24 Aug 2021 17:40:24 +0000</pubDate>
      <link>https://dev.to/kennethatria/git-practices-with-git-flow-and-semantic-versioning-4dhf</link>
      <guid>https://dev.to/kennethatria/git-practices-with-git-flow-and-semantic-versioning-4dhf</guid>
      <description>&lt;p&gt;There are a few things i wish i knew when i started software development and among them are methodologies like git-flow and semantic versioning.&lt;/p&gt;

&lt;p&gt;We shall start off with understanding what git-flow and semantic versioning then finish up experiment with git-flow.&lt;/p&gt;

&lt;h3&gt;
  
  
  GIT STRUCTURE
&lt;/h3&gt;

&lt;p&gt;Setting up the right git structure earlier will set your project for success&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ezxBAXFE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qz8plggztl7da1hgcqz7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ezxBAXFE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qz8plggztl7da1hgcqz7.png" alt="image"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  OVERVIEW
&lt;/h4&gt;

&lt;p&gt;We create two mandatory branches which are the Master and Development branches that we shall base our temporary branches from. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Temporary branches:&lt;/strong&gt; &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;em&gt;Hot fixes&lt;/em&gt;: This is from the master branch and merged back into master. This branch is used when a fix can’t wait for the next release from development and a fix is urgently needed.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;em&gt;Releases&lt;/em&gt;: This is got from development branch and is merged back into development. This branch contains what is staging&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;em&gt;Features&lt;/em&gt;: This is the same as the releases branch coming from our development branch. This temporary branch is used when creating new features, minor updates and patches.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Using the above structure we created with semantic versioning&lt;/strong&gt;&lt;br&gt;
Semantic versioning is a means of versioning releases in your development environment. This can help you keep track of everything and help reduce the so-called dependency hell during release.&lt;/p&gt;

&lt;p&gt;For example: &lt;strong&gt;v1.1.1&lt;/strong&gt;(M.M.P standing for MAJOY-MINOR-PATCH). So, 1.2.1 to 3.3.4 would translate to 2 major changes that are not backward compatible, 3 minor changes and 4 patches backward compatible from version 3.0.0. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What are major changes?&lt;/strong&gt;&lt;br&gt;
Changes made to configuration that are not backward compatible. This will include:&lt;br&gt;
addition of application workflows&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;supporting functions to new application workflows
What are minor changes?
modification made to configuration that are backward compatible. This will include:&lt;/li&gt;
&lt;li&gt;modification to features to improve performance
What is a patch?
This includes bug fixes that are backward compatible&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Using our git structure and Semantic versioning together
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--QkHPvfFw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dbbu9b9ewlizzy9ldtg8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--QkHPvfFw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dbbu9b9ewlizzy9ldtg8.png" alt="image"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So we have a work request for the development of a new feature.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;A temporary &lt;strong&gt;feature branch&lt;/strong&gt; is created from development branch that is at v3.6.5&lt;/li&gt;
&lt;li&gt;Branch under goes changes as feature development is in progress&lt;/li&gt;
&lt;li&gt;Not just one developer is working on this but it’s a collaboration of more than one developer&lt;/li&gt;
&lt;li&gt;We finally have branch @v3.9.9 ready for release and testing on our staging instance&lt;/li&gt;
&lt;li&gt;A temporary &lt;strong&gt;release branch&lt;/strong&gt; is created based off development @3.6.5 and is used to introduce changes from the ready feature branch&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Okay !!! I guess Ninjas want to start doing this the hard way but we have git-flow to help us with this.&lt;/p&gt;

&lt;h3&gt;
  
  
  Let's open up that shell and wrap up this
&lt;/h3&gt;

&lt;p&gt;Setting up git-flow. for this case Ubuntu&lt;br&gt;
&lt;code&gt;apt-get install git-flow&lt;/code&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Initializing git-flow&lt;/strong&gt; : In your project &lt;code&gt;git flow init&lt;/code&gt;
You will prompted to input your master, development and temporary branches(support, hotfix, feature). You can rename this branches to suit your branch-naming-convention&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;note : incase you want to change your master branch to let's say main just run : &lt;code&gt;git flow init -f&lt;/code&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Start feature development&lt;/strong&gt; : &lt;code&gt;git flow feature start feature-x&lt;/code&gt;
If you input &lt;code&gt;git branch&lt;/code&gt; you will notice feature-x branch has been created&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Publish a feature&lt;/strong&gt; : &lt;code&gt;git flow feature publish feature-x&lt;/code&gt;. 
The feature is now available on remote, allowing other developers collaborate on to feature-x&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;incase your development branch is updates to continue working with what's up to date run &lt;code&gt;git flow feature rebase&lt;/code&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Collaborating developers&lt;/strong&gt; : &lt;code&gt;git flow feature pull origin feature-x&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Finish up a feature&lt;/strong&gt; : &lt;code&gt;git flow feature finish feature-x&lt;/code&gt;
And that's it, feature-x branch has been merged into development and been deleted. if you input &lt;code&gt;git branch&lt;/code&gt; you will verify this&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Getting features out&lt;br&gt;
&lt;code&gt;git flow release start feature-x-release&lt;/code&gt;&lt;br&gt;
you can also add  to the end of the above command to &lt;br&gt;
create a release branch based off of development branch at a certain point in time.&lt;br&gt;
&lt;code&gt;git flow release finish feature-x-release&lt;/code&gt;&lt;br&gt;
don't forget to use tags&lt;/p&gt;

&lt;p&gt;Finally Hotfixes&lt;br&gt;
&lt;code&gt;git flow hotfix start feature-x-patch&lt;/code&gt;&lt;br&gt;
Again you can add a  at the end of above command to start at a certain point of the master branch.&lt;br&gt;
&lt;code&gt;git flow hotfix finish feature-x-patch&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Other considerations&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Don't forget to set up branch protection rules for your development and especially &lt;code&gt;master&lt;/code&gt; branch.&lt;/li&gt;
&lt;li&gt;Assign one or two team members(preferably two) the responsibly of monitoring policies you set around git usage.&lt;/li&gt;
&lt;li&gt;keep looking out there for new standards to improve your current standards&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Conclusion:
&lt;/h3&gt;

&lt;p&gt;Git-flow does make things easier and keeps things sane but am not saying methodology is one shoe-size fits all, You will need to adjust it to your needs. I would also encourage you to look up &lt;a href="https://trunkbaseddevelopment.com/#trunk-based-development-for-smaller-teams"&gt;Trunk development&lt;/a&gt; that suits teams trying to get that MVP out there as fast as possible.&lt;/p&gt;

&lt;p&gt;Hope this helps, Have fun doing and learning. &lt;/p&gt;

</description>
      <category>github</category>
      <category>devops</category>
    </item>
    <item>
      <title>Setting up a CI/CD with Jenkins</title>
      <dc:creator>Kenneth Atria</dc:creator>
      <pubDate>Mon, 16 Aug 2021 22:41:41 +0000</pubDate>
      <link>https://dev.to/kennethatria/setting-up-a-ci-cd-with-jenkins-4hln</link>
      <guid>https://dev.to/kennethatria/setting-up-a-ci-cd-with-jenkins-4hln</guid>
      <description>&lt;h3&gt;
  
  
  ** What you need ? **
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Dockerhub and Github Account&lt;/li&gt;
&lt;li&gt;Server with linux setup. For this case ubuntu&lt;/li&gt;
&lt;li&gt;Your application is already configured on your test instances&lt;/li&gt;
&lt;li&gt;This tutorial assumes you have set up a Jenkins file in your project. View &lt;a href="https://github.com/kennethatria/my_guy/blob/master/Jenkinsfile" rel="noopener noreferrer"&gt;reference&lt;/a&gt; and make necessary changes&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  1. Installing Jenkins on your Server
&lt;/h4&gt;

&lt;p&gt;&lt;code&gt;sudo apt update&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;search of all available packages &amp;amp; pick one from the options&lt;br&gt;
&lt;code&gt;sudo apt search openjdk&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;For this case I will be using version 11, so &lt;br&gt;
&lt;code&gt;sudo apt install openjdk-11-jdk&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Confirm installation with running version check&lt;br&gt;
&lt;code&gt;java -version&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Now we are ready to install Jenkins. We start off by appending the Debian package repository address to the server's sources.list&lt;/p&gt;

&lt;p&gt;&lt;code&gt;wget -q -O - https://pkg.jenkins.io/debian-stable/jenkins.io.key | sudo apt-key add - sudo sh -c 'echo deb https://pkg.jenkins.io/debian-stable binary/ &amp;gt; \&lt;br&gt;
    /etc/apt/sources.list.d/jenkins.list'&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;We'll run update so that apt will use the new repo&lt;br&gt;
&lt;code&gt;sudo apt-get update&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Installing Jenkins&lt;br&gt;
&lt;code&gt;sudo apt-get install jenkins=2.289.3&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;That's all &lt;/p&gt;

&lt;h4&gt;
  
  
  2. Setting up your Github and retrieving an API key
&lt;/h4&gt;

&lt;p&gt;Login into your Github, and head over to your developer settings : &lt;code&gt;Profile -&amp;gt; Settings -&amp;gt; Developer settings -&amp;gt; Personal access tokens&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Note: I wouldn't consider this optional but it's good practice to set an expiration duration for your token.&lt;/p&gt;

&lt;p&gt;Select admin:repo_hook&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3r17jzgg36s0cl240q74.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3r17jzgg36s0cl240q74.png" alt="Screenshot 2021-08-06 at 07.38.06"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Lastly set &lt;code&gt;repo: *repo_status*&lt;/code&gt;. Jenkins likes to access the repo commit status&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhmc62i2c6nuq0mnzmb04.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhmc62i2c6nuq0mnzmb04.png" alt="Screenshot 2021-08-06 at 07.33.21"&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Click "Generate token" and save your token somewhere.&lt;/p&gt;

&lt;h4&gt;
  
  
  3. Setting up Jenkins
&lt;/h4&gt;

&lt;h5&gt;
  
  
  3.1 Setting up an Administrator
&lt;/h5&gt;

&lt;p&gt;1.SSH in your Jenkins instance&lt;br&gt;
2.To retrieve your temporary password&lt;br&gt;
&lt;code&gt;sudo "cat /var/lib/jenkins/secrets/initialAdminPassword"&lt;/code&gt;&lt;br&gt;
3.Visit &lt;code&gt;&amp;lt;your-instance-ip:8080&amp;gt;&lt;/code&gt;&lt;br&gt;
4.Paste retrieved password into Jenkins start up page.&lt;br&gt;
5.Go ahead and set up a permanent admin user on Jenkins&lt;/p&gt;

&lt;h5&gt;
  
  
  3.2 Setting up your Jenkin Projects
&lt;/h5&gt;

&lt;p&gt;1.Log into Jenkins&lt;/p&gt;

&lt;p&gt;2.Set up credentials in Jenkins will use to login into servers. &lt;br&gt;
Click &lt;em&gt;Credentials&lt;/em&gt; -&amp;gt; click &lt;em&gt;global&lt;/em&gt; -&amp;gt; click &lt;em&gt;add credentials&lt;/em&gt; and input your instance username: deploy, password :+++++, id: webserver_login&lt;/p&gt;

&lt;p&gt;3.Set up docker hub credentials too: &lt;br&gt;
username: username, password :access-token, id: docker_hub_login&lt;/p&gt;

&lt;p&gt;4.Set up global properties in Jenkins for staging server&lt;br&gt;
Click "Manage Jenkins" - "Configure System" - "Global properties and select Environment Variables" -&amp;gt; Add&lt;br&gt;
input "name: staging_ip" and "value:staging-ip-address"&lt;/p&gt;

&lt;p&gt;5.Set up Jenkins project&lt;br&gt;
Give your project a name -&amp;gt; Select Multibranch pipeline for project type&lt;/p&gt;

&lt;p&gt;Under branch sources: click add source -&amp;gt; &lt;code&gt;GitHub&lt;/code&gt;&lt;br&gt;
Enter the details and use your GitHub access token as password and Github username as the username, set id e.g "github_key" and description&lt;/p&gt;

&lt;p&gt;Select &lt;code&gt;github_key&lt;/code&gt; for credentials&lt;br&gt;
Input your GitHub name into owner field &lt;br&gt;
Set repository as intended repo&lt;br&gt;
Go a head and Save&lt;/p&gt;

&lt;p&gt;Jenkins will scan your repo and run an initial build&lt;/p&gt;

&lt;p&gt;Click Jenkins, In the project - click &lt;code&gt;Master&lt;/code&gt; -&amp;gt; &lt;code&gt;Build now&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Next up
&lt;/h2&gt;

&lt;p&gt;Powering up and down developer AWS instances using Slack and Jenkins&lt;/p&gt;

</description>
      <category>devops</category>
      <category>jenkins</category>
      <category>docker</category>
      <category>cdci</category>
    </item>
  </channel>
</rss>
