{"id":42586,"date":"2016-11-29T15:47:59","date_gmt":"2016-11-29T10:17:59","guid":{"rendered":"http:\/\/www.tothenew.com\/blog\/?p=42586"},"modified":"2016-11-29T15:47:59","modified_gmt":"2016-11-29T10:17:59","slug":"an-introduction-to-circleci","status":"publish","type":"post","link":"https:\/\/www.tothenew.com\/blog\/an-introduction-to-circleci\/","title":{"rendered":"An Introduction to CircleCI"},"content":{"rendered":"<p>CircleCI is the <a title=\"Continuous Delivery using Jenkins\" href=\"http:\/\/www.tothenew.com\/blog\/continuous-delivery-pipeline-jenkins-delivery-pipeline-view-plugin\/\" target=\"_blank\">continuous integration &amp; delivery<\/a> platform that helps development teams to release code rapidly and automate the build, test, and deploy process using <a title=\"DevOps Tools\" href=\"http:\/\/www.tothenew.com\/devops-chef-puppet-docker\" target=\"_blank\">Docker container<\/a>. CircleCI is a reliable platform that works well with languages like Ruby, Python, NodeJS, Java and Clojure.<\/p>\n<h3 style=\"text-align: justify\"><strong>Steps to Signup with CircleCI<\/strong><\/h3>\n<p style=\"text-align: justify\">Signing up with CircleCI using GitHub or Bitbucket is free.<\/p>\n<p style=\"text-align: justify\">Then next step is to authorize CircleCI to access your code base using repositories by clicking the &#8220;ADD PROJECTS&#8221; on CircleCI console.<\/p>\n<p style=\"text-align: justify\"><img decoding=\"async\" loading=\"lazy\" class=\"alignleft wp-image-42587 size-full\" src=\"\/blog\/wp-ttn-blog\/uploads\/2016\/11\/circleCI1.png\" alt=\"circleCI1\" width=\"1301\" height=\"680\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2016\/11\/circleCI1.png 1301w, \/blog\/wp-ttn-blog\/uploads\/2016\/11\/circleCI1-300x156.png 300w, \/blog\/wp-ttn-blog\/uploads\/2016\/11\/circleCI1-1024x535.png 1024w, \/blog\/wp-ttn-blog\/uploads\/2016\/11\/circleCI1-624x326.png 624w\" sizes=\"(max-width: 1301px) 100vw, 1301px\" \/><\/p>\n<p>Then add the repositories you want to build from your GitHub\/BitBucket.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignleft wp-image-42608 size-full\" src=\"\/blog\/wp-ttn-blog\/uploads\/2016\/11\/circleCI2.png\" alt=\"circleCI2\" width=\"1300\" height=\"714\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2016\/11\/circleCI2.png 1300w, \/blog\/wp-ttn-blog\/uploads\/2016\/11\/circleCI2-300x164.png 300w, \/blog\/wp-ttn-blog\/uploads\/2016\/11\/circleCI2-1024x562.png 1024w, \/blog\/wp-ttn-blog\/uploads\/2016\/11\/circleCI2-624x342.png 624w\" sizes=\"(max-width: 1300px) 100vw, 1300px\" \/><\/p>\n<h3><strong>\u00a0Configure CircleCI<\/strong><\/h3>\n<p>CircleCI automatically analyzes your code settings and works fine most of the time. But if it\u00a0doesn\u2019t work\u00a0then you need to configure the <code class=\"highlighter-rouge\">circle.yml<\/code> file. This file helps and informs CircleCI about the exact action a user intends to perform on his build. This is a simple YAML file where you need to put the build steps as per CircleCI file structure and content.\u00a0The other additional steps like initializing <code class=\"highlighter-rouge\">circle.yml<\/code>\u00a0is done by placing the YAML file in the repo\u2019s root directory and then CircleCI reads the file each time it runs a build using the YAML file.<\/p>\n<p>Also, circle.yml file is completely optional. You will override this file by using the additional GUI option. But if by mistake you define &#8220;Test Commands&#8221; in GUI and also inherit <code class=\"highlighter-rouge\">circle.yml<\/code> in your code then CircleCI will infer variables, environment etc from your circle.yml<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignleft wp-image-42618 size-full\" src=\"\/blog\/wp-ttn-blog\/uploads\/2016\/11\/circleCI3.png\" alt=\"circleCI3\" width=\"1289\" height=\"679\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2016\/11\/circleCI3.png 1289w, \/blog\/wp-ttn-blog\/uploads\/2016\/11\/circleCI3-300x158.png 300w, \/blog\/wp-ttn-blog\/uploads\/2016\/11\/circleCI3-1024x539.png 1024w, \/blog\/wp-ttn-blog\/uploads\/2016\/11\/circleCI3-624x328.png 624w\" sizes=\"(max-width: 1289px) 100vw, 1289px\" \/><\/p>\n<p>In GUI builder console, CircleCI examines your repository and attempts to auto-inherit the type of build system\u00a0used in your repo.<\/p>\n<p>Here are the detailed steps in each build Each build clearly shows the detailed steps involved:<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignleft wp-image-42621 size-full\" src=\"\/blog\/wp-ttn-blog\/uploads\/2016\/11\/circleCI4.png\" alt=\"circleCI4\" width=\"1276\" height=\"676\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2016\/11\/circleCI4.png 1276w, \/blog\/wp-ttn-blog\/uploads\/2016\/11\/circleCI4-300x158.png 300w, \/blog\/wp-ttn-blog\/uploads\/2016\/11\/circleCI4-1024x542.png 1024w, \/blog\/wp-ttn-blog\/uploads\/2016\/11\/circleCI4-624x330.png 624w\" sizes=\"(max-width: 1276px) 100vw, 1276px\" \/><\/p>\n<p><strong>Build Environment<\/strong><\/p>\n<p>With a custom circle.yml you are free to prepare an environment for your application code dependency. CircleCI&#8217;s build servers have already pre-installed languages and build tools such as Java, Gradle, Maven that you need for a standard development. You can add other services easily by enabling parameter in circle.yml\u00a0like MySQL , ElasticSearch\u00a0etc<\/p>\n<p>Below are six primary <a href=\"https:\/\/circleci.com\/docs\/configuration\/\">phases<\/a>\u00a0that are used in CircleCI to build your code<\/p>\n<p>1) machine: adjusting the VM to your preferences and requirements<br \/>\n2) checkout: git repo checking out and cloning feature<br \/>\n3) dependencies: setting up your project\u2019s language-specific dependencies<br \/>\n4) database: preparing the databases for your tests<br \/>\n5) test: running your tests<br \/>\n6) deployment: deploying your code to your web servers<\/p>\n<p>Note: \u00a0Most of the projects does not need to specify anything for these phases<\/p>\n<h3 id=\"documentation\">Documentation<\/h3>\n<p><a href=\"https:\/\/circleci.com\/docs\/enterprise\/\">Documentation<\/a> in CircleCI for enterprise and non-enterprise is very extensive. It contains guides specific to each language along with the reference information.<\/p>\n<h3><strong>Pricing<\/strong><\/h3>\n<p>CircleCI has three different pricing plans for Linux , OS X and Enterprise respectively.<\/p>\n<p><strong>Build on Linux<\/strong>:\u00a0The first container is free + each additional container is $50\/month.<\/p>\n<p><strong>Build on OS X<\/strong>:<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignleft wp-image-42631 size-full\" src=\"\/blog\/wp-ttn-blog\/uploads\/2016\/11\/circle7.png\" alt=\"circle7\" width=\"1223\" height=\"605\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2016\/11\/circle7.png 1223w, \/blog\/wp-ttn-blog\/uploads\/2016\/11\/circle7-300x148.png 300w, \/blog\/wp-ttn-blog\/uploads\/2016\/11\/circle7-1024x506.png 1024w, \/blog\/wp-ttn-blog\/uploads\/2016\/11\/circle7-624x308.png 624w\" sizes=\"(max-width: 1223px) 100vw, 1223px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p><strong>Enterprise<\/strong>:\u00a0CircleCI Enterprise is available for a <strong>free, no-obligation 30-day trial.<\/strong><\/p>\n<h3>Troubleshooting<\/h3>\n<p>Often the best way to troubleshoot problems is to SSH into a running or finished build to look at log files, error messages, running processes, and so on.<\/p>\n<p>To enable SSH access for a running build, you need to select the option \u2018Debug via SSH\u2019 tab and click the \u2018Enable SSH for this build\u2019 \u00a0button from drag down option.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignleft wp-image-42638 size-full\" src=\"\/blog\/wp-ttn-blog\/uploads\/2016\/11\/Screenshot-from-2016-11-25-150809.png\" alt=\"Screenshot from 2016-11-25 15:08:09\" width=\"884\" height=\"298\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2016\/11\/Screenshot-from-2016-11-25-150809.png 884w, \/blog\/wp-ttn-blog\/uploads\/2016\/11\/Screenshot-from-2016-11-25-150809-300x101.png 300w, \/blog\/wp-ttn-blog\/uploads\/2016\/11\/Screenshot-from-2016-11-25-150809-624x210.png 624w\" sizes=\"(max-width: 884px) 100vw, 884px\" \/><\/p>\n<p>To start a fresh build with SSH enabled, for example, if you want to troubleshoot a build that has already finished, click the \u2018with ssh\u2019 button alongside \u2018Rebuild\u2019:<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignleft wp-image-42639 size-full\" src=\"\/blog\/wp-ttn-blog\/uploads\/2016\/11\/circleCI.png\" alt=\"circleCI\" width=\"1203\" height=\"230\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2016\/11\/circleCI.png 1203w, \/blog\/wp-ttn-blog\/uploads\/2016\/11\/circleCI-300x57.png 300w, \/blog\/wp-ttn-blog\/uploads\/2016\/11\/circleCI-1024x195.png 1024w, \/blog\/wp-ttn-blog\/uploads\/2016\/11\/circleCI-624x119.png 624w\" sizes=\"(max-width: 1203px) 100vw, 1203px\" \/><\/p>\n<p>And host and port information for the container will be available in the \u2018Debug via SSH tab\u2019:<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignleft wp-image-42640 size-full\" src=\"\/blog\/wp-ttn-blog\/uploads\/2016\/11\/Screenshot-from-2016-11-25-151446.png\" alt=\"Screenshot from 2016-11-25 15:14:46\" width=\"880\" height=\"187\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2016\/11\/Screenshot-from-2016-11-25-151446.png 880w, \/blog\/wp-ttn-blog\/uploads\/2016\/11\/Screenshot-from-2016-11-25-151446-300x63.png 300w, \/blog\/wp-ttn-blog\/uploads\/2016\/11\/Screenshot-from-2016-11-25-151446-624x132.png 624w\" sizes=\"(max-width: 880px) 100vw, 880px\" \/><\/p>\n<h3 id=\"post-build-stepsdeployments\">Post-Build Steps \/ Deployments<\/h3>\n<p>CircleCI allows you to define artifact files for your build that will survive and can be collected afterwards. This is very helpful if you want to deploy anything and just want to fetch the final outcome of the build.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignleft wp-image-42637 size-full\" src=\"\/blog\/wp-ttn-blog\/uploads\/2016\/11\/circle9.png\" alt=\"circle9\" width=\"1203\" height=\"304\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2016\/11\/circle9.png 1203w, \/blog\/wp-ttn-blog\/uploads\/2016\/11\/circle9-300x75.png 300w, \/blog\/wp-ttn-blog\/uploads\/2016\/11\/circle9-1024x258.png 1024w, \/blog\/wp-ttn-blog\/uploads\/2016\/11\/circle9-624x157.png 624w\" sizes=\"(max-width: 1203px) 100vw, 1203px\" \/><\/p>\n<h3>My Verdict<\/h3>\n<p>I would strongly recommend you to use CircleCI in your project. It was an enriching experience working with CircleCI especially using the killer features like circle.yml and integrating external services like MySQL, ElasticSearch directly in your code with SSH support and reporting of JUnit.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>CircleCI is the continuous integration &amp; delivery platform that helps development teams to release code rapidly and automate the build, test, and deploy process using Docker container. CircleCI is a reliable platform that works well with languages like Ruby, Python, NodeJS, Java and Clojure. Steps to Signup with CircleCI Signing up with CircleCI using GitHub [&hellip;]<\/p>\n","protected":false},"author":215,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":4},"categories":[2348,1],"tags":[3927,4252,4254,4251,3321,3270,1345,1682,4078,4253],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/42586"}],"collection":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/users\/215"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/comments?post=42586"}],"version-history":[{"count":0,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/42586\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/media?parent=42586"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/categories?post=42586"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/tags?post=42586"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}