<?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: João Brito</title>
    <description>The latest articles on DEV Community by João Brito (@juniorjbn).</description>
    <link>https://dev.to/juniorjbn</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%2F126695%2F56f44cad-e183-4119-b498-528b91be2101.jpg</url>
      <title>DEV Community: João Brito</title>
      <link>https://dev.to/juniorjbn</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/juniorjbn"/>
    <language>en</language>
    <item>
      <title>Work Smarter, Not Harder</title>
      <dc:creator>João Brito</dc:creator>
      <pubDate>Mon, 07 Jan 2019 16:12:26 +0000</pubDate>
      <link>https://dev.to/juniorjbn/work-smarter-not-harder-3c24</link>
      <guid>https://dev.to/juniorjbn/work-smarter-not-harder-3c24</guid>
      <description>&lt;p&gt;Let’s take a moment to think about the picture above. The guy with the ball may have spent a little more time to get started. He may have received some bad feedback about his late start and the first results of others. A bit further along the line, though, he caught up with and overtook the others, and the gap between them has been growing since then.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;With this in mind, using a tool to automate and integrate all your pipeline from “push” to “deploy” will speed up your work and provide your team the ability to fail fast and fix faster. Even if this takes a little more time from you to set up, it will buy you some distance in the future.&lt;/p&gt;

&lt;p&gt;You have probably already heard of Jenkins, an awesome tool with a lot of plugins that we have already introduced &lt;a href="https://blog.getupcloud.com/from-dev-to-prod-image-promotion-made-easy-8fb1b0f9a705"&gt;in this post&lt;/a&gt;.&lt;br&gt;
Well, now we are going to connect it with Github, Openshift and Slack. And not just the work but also your team will be integrated.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;First of all, it is pretty simple to have your own Jenkins on our platform: once you select it on applications in few seconds it is ready to use.&lt;/p&gt;

&lt;p&gt;Here is an example. Let’s consider a PHP sample application, in 3 environments: Development, QA and Production. Our Dev environment will be the only one to build, after that, Jenkins will run tests and tag its image to use in QA, and will wait for a manual approval to promote the changes to Production.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;So as not to mess things up, I wrote another post entitled&lt;/strong&gt;&lt;a href="https://blog.getupcloud.com/creating-app-from-image-with-tag-8fb1b0f9a705"&gt; Create and Tag images&lt;/a&gt;&lt;strong&gt;, but if you are comfortable with this tasks, keep walking.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Grant Jenkins access to administer applications on openshift: &lt;em&gt;oc policy&lt;br&gt;
add-role-to-user admin system:serviceaccount:jenkins:default&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;After that, Jenkins needs to be set up to connect and integrate with your&lt;br&gt;
account and application, so let’s do it:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Configure jenkins openshift plugin:&lt;/strong&gt; With our image we already export your&lt;br&gt;
credentials and configs to jenkins, so just go to plugins area and install the&lt;br&gt;
github and slack plugins and update all others.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Configure jenkins github plugin:&lt;/strong&gt; In the “&lt;a href="http://jenkins-meu-teste.getup.io/manage"&gt;Manage Jenkins&lt;/a&gt;” area you can set it up like this example. &lt;em&gt;Pro-Tip: you need to generate the token first&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--zfL7QkQ---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1600/1%2AZcPqyT_E1y0vFPY0pgN2JQ.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--zfL7QkQ---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1600/1%2AZcPqyT_E1y0vFPY0pgN2JQ.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Configure jenkins slack plugin:&lt;/strong&gt; Generate your chanel token -&amp;gt;&lt;br&gt;
&lt;a href="https://api.slack.com/tokens"&gt;https://api.slack.com/tokens&lt;/a&gt; and fill the form.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--alZEkrda--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1600/1%2Ar-ldtrko3UojX2R1RTztag.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--alZEkrda--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1600/1%2Ar-ldtrko3UojX2R1RTztag.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Create new jenkins project with pipeline option:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--3zz9U3ms--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1600/1%2AGJfetW_8VvICftLqOXcEWg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--3zz9U3ms--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1600/1%2AGJfetW_8VvICftLqOXcEWg.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Jenkinsfile Sample:&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;This Jenkinsfile is almost self explanatory. Its integration with openshift&lt;br&gt;
occurs like magic, the DeployConfig and Project names just need to be set up and voilà! Everything is connected, and you’ll be free to manage your project from here. Everything in your hands with versioning and control.&lt;/p&gt;

&lt;p&gt;In the "Approval" stage, use the "submitter" parameter on to set the user that is allowed to interact with it.&lt;br&gt;
On TAG, QA is a DEV TAG, and PROD is a QA TAG not DEV.&lt;br&gt;
Use Environment Variables on your project, so your app will have different behaviors in different environments, yet with the same app.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;**Build manually: **let’s see the magic!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--0A8I7FK4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1600/1%2A9CJe2WajVJlfrCOAiIbmsQ.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--0A8I7FK4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1600/1%2A9CJe2WajVJlfrCOAiIbmsQ.png" alt=""&gt;&lt;/a&gt;&lt;br&gt;
&lt;span class="figcaption_hack"&gt;Inside your job, click to run your build!&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Configure Github Webhook:&lt;/strong&gt; As you have already set up the github plugin, you do not need to click every time on the build button. A github webhook can be set up, just go to you project settings &lt;em&gt;(&lt;a href="https://github.com/"&gt;https://github.com/&lt;/a&gt;&lt;/em&gt;&lt;strong&gt;USER/PROJECT&lt;/strong&gt;&lt;em&gt;/settings/hooks)&lt;/em&gt; and add a new webhook&lt;br&gt;
like this &lt;em&gt;(http://&lt;/em&gt;&lt;strong&gt;jenkinsURL&lt;/strong&gt;&lt;em&gt;/github-webhook/).&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;All you need now is code, commit and push to start your pipeline, and from now till forever you just code, you just think about your product and your customers. And happy customers means more money to your business which, in turn, make you even happier.&lt;/p&gt;

&lt;p&gt;Jenkins has a lot of others plugins, more than you imagine, and you are free to adjust it to your needs.&lt;/p&gt;

&lt;p&gt;Bonus: I have been using an new Jenkins UI called “Blue-Ocean”. It is material design and brings a beautiful interface to Jenkins… see it for yourself:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--hL9Ht_r0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1600/1%2AhhTchMN9e11n616Sqn2Wtg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--hL9Ht_r0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1600/1%2AhhTchMN9e11n616Sqn2Wtg.png" alt=""&gt;&lt;/a&gt;&lt;br&gt;
&lt;span class="figcaption_hack"&gt;The Old or current interface :(&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--0mRlONmh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1600/1%2AjoF9j8heOPqASYy4EtXmdA.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--0mRlONmh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1600/1%2AjoF9j8heOPqASYy4EtXmdA.png" alt=""&gt;&lt;/a&gt;&lt;br&gt;
&lt;span class="figcaption_hack"&gt;The new UI project&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--KI_DzP70--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1600/1%2AesICrLsnjzM9SEIegFdJZA.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--KI_DzP70--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1600/1%2AesICrLsnjzM9SEIegFdJZA.png" alt=""&gt;&lt;/a&gt;&lt;br&gt;
&lt;span class="figcaption_hack"&gt;The pipeline view :D&lt;/span&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;You have come this far, thank you!&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Learn more:&lt;/p&gt;

&lt;p&gt;— &lt;a href="https://blog.openshift.com/pipelines-with-jenkins-2-on-openshift/"&gt;Pipeline with openshift&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;— &lt;a href="https://github.com/openshift/jenkins-plugin"&gt;Openshift Jenkins Plugin&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;— &lt;a href="https://wiki.jenkins-ci.org/display/JENKINS/Home"&gt;Jenkins CI&lt;/a&gt;&lt;/p&gt;




&lt;blockquote&gt;
&lt;p&gt;*Before you go…. think again! *For new achievements, new approaches are needed !&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--8tBIzqKv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/2000/1%2AuIwDesGWBik5LfHcfURFmw.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--8tBIzqKv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/2000/1%2AuIwDesGWBik5LfHcfURFmw.jpeg" alt=""&gt;&lt;/a&gt;&lt;/p&gt;




&lt;ul&gt;
&lt;li&gt;&lt;a href="https://blog.getupcloud.com/tagged/jenkins?source=post"&gt;Jenkins&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://blog.getupcloud.com/tagged/continuous-integration?source=post"&gt;Continuous
Integration&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://blog.getupcloud.com/tagged/openshift?source=post"&gt;Openshift&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://blog.getupcloud.com/tagged/kubernetes?source=post"&gt;Kubernetes&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://blog.getupcloud.com/tagged/pipeline?source=post"&gt;Pipeline&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>kubernetes</category>
      <category>jenkins</category>
      <category>devops</category>
      <category>cicd</category>
    </item>
  </channel>
</rss>
