{"id":89362,"date":"2020-10-05T12:22:45","date_gmt":"2020-10-05T06:52:45","guid":{"rendered":"https:\/\/blogs_admin.quickheal.com\/?p=89362"},"modified":"2023-06-16T16:42:41","modified_gmt":"2023-06-16T11:12:41","slug":"evergreen-make-utility-cost-effective-way-deployments-cloud","status":"publish","type":"post","link":"https:\/\/www.quickheal.com\/blogs\/evergreen-make-utility-cost-effective-way-deployments-cloud\/","title":{"rendered":"The Evergreen Make Utility: A cost-effective way of deployments on Cloud"},"content":{"rendered":"<p>It might be difficult to find a software engineer who does not know <strong>\u2018Make\u2019<\/strong> utility. <strong>\u2018GNU Make\u2019<\/strong> is a tool which controls the generation of executables and other stuff related to the application code building.<\/p>\n<p>Capabilities of <strong>\u2018Make\u2019<\/strong> are many ranging from simple code compilation and installation to collection of all the dependencies of an application. It is designed so nicely that we can even use it for implementing the deployment pipeline for your solution. Let us see how we can achieve this.<\/p>\n<p>One of our recent needs was to automate the deployment of our services onto the cloud. Since our system is central to many other products and services, we ended up needing multiple environments to be used for distinct purposes such as functional testing, performance testing, integration, etc.<\/p>\n<p>To cater to this demand for a dedicated environment, we thought of using <strong>\u2018Make\u2019<\/strong> utility instead of any other cloud-specific tools. And we are so happy that our technology choice worked well. Let us walk you through the details.<\/p>\n<p>We had decided to keep the number of new <a href=\"https:\/\/www.quickheal.co.in\/free-tools\/\">tools<\/a> and technologies minimum and stick to the open-source technologies only, as keeping the cost of operation to the minimum was one of the constraints. We were already using the \u2018Make\u2019 tool for building our components written in <strong>\u2018Go\u2019<\/strong> language. The next step for us was to use it for triggering docker image build operation, pushing the image to the private repository, and for launching\/creating all cloud services required for the functioning of our services.<\/p>\n<p><strong>Makefile<\/strong> target rule helped us to divide the entire flow into smaller independent modules. We wrote separate target rules for each step such as building a docker image, pushing images and launching clusters, etc.<\/p>\n<h3><strong>Code build and Docker image creation<\/strong><\/h3>\n<p><strong>build:<\/strong><\/p>\n<blockquote><p><em>@echo &#8220;Code compilation &#8230;&#8221;<\/em><\/p>\n<p><em># Language specific build commands go here.<\/em><\/p><\/blockquote>\n<p>&nbsp;<\/p>\n<p><strong>docker-build: build<\/strong><\/p>\n<blockquote><p><em>@echo &#8220;Building docker image &#8230;&#8221;<\/em><\/p>\n<p><em>$(DOCKERBUILD) . -t $(ENV)$(BINARY_NAME) -f $(PROJBASE)\/Dockerfile<\/em><\/p><\/blockquote>\n<p>&nbsp;<\/p>\n<h3><strong>Pushing the docker image to the private repository<\/strong><\/h3>\n<p><strong>docker-push:<\/strong><\/p>\n<blockquote><p><em>@echo &#8220;Pushing docker image to cloud hub &#8230;&#8221;<\/em><\/p>\n<p><em># This contains, cloud service-provider specific commands to push the docker image to the respective repository<\/em><\/p><\/blockquote>\n<p>&nbsp;<\/p>\n<h3><strong>Deploy the application to the respective cloud<\/strong><\/h3>\n<p><strong>deploy:<\/strong><\/p>\n<blockquote><p><em>@echo &#8220;Deploying application to the environment &#8230;&#8221;<\/em><\/p>\n<p><em># This contains, cloud service-provider specific commands to deploy the application to the cluster.<\/em><\/p>\n<p><em># For example, for the AWS cloud, this will contain a cloudformation command to create a stack.<\/em><\/p>\n<p><em># Likewise, Terraform can also be used to deploy the application to the respective cloud.<\/em><\/p><\/blockquote>\n<h3><strong>Initiate table creation<\/strong><\/h3>\n<p><strong>create-table:<\/strong><\/p>\n<blockquote><p><em># This contains, creation of all the application tables.<\/em><\/p>\n<p><em>@sh deployment\/table_creation.sh<\/em><\/p><\/blockquote>\n<p>&nbsp;<\/p>\n<h3><strong>Initiate end to end deployment<\/strong><\/h3>\n<blockquote><p><em><strong>e2e-deploy: docker-build docker-push create-table deploy<\/strong><\/em><\/p><\/blockquote>\n<p>That is it. Isn\u2019t it a simple yet effective approach to trigger application deployment? Moreover, it enables one to achieve application deployment to any cloud in a cost-effective manner. And, it is a cloud-agnostic way of deployment, so nothing is tightly coupled.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>It might be difficult to find a software engineer who does not know \u2018Make\u2019 utility. \u2018GNU Make\u2019 is a tool which controls the generation of executables and other stuff related to the application code building. Capabilities of \u2018Make\u2019 are many ranging from simple code compilation and installation to collection of all the dependencies of an [&hellip;]<\/p>\n","protected":false},"author":82,"featured_media":89363,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-89362","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.quickheal.com\/blogs\/wp-json\/wp\/v2\/posts\/89362"}],"collection":[{"href":"https:\/\/www.quickheal.com\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.quickheal.com\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.quickheal.com\/blogs\/wp-json\/wp\/v2\/users\/82"}],"replies":[{"embeddable":true,"href":"https:\/\/www.quickheal.com\/blogs\/wp-json\/wp\/v2\/comments?post=89362"}],"version-history":[{"count":3,"href":"https:\/\/www.quickheal.com\/blogs\/wp-json\/wp\/v2\/posts\/89362\/revisions"}],"predecessor-version":[{"id":91565,"href":"https:\/\/www.quickheal.com\/blogs\/wp-json\/wp\/v2\/posts\/89362\/revisions\/91565"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.quickheal.com\/blogs\/wp-json\/wp\/v2\/media\/89363"}],"wp:attachment":[{"href":"https:\/\/www.quickheal.com\/blogs\/wp-json\/wp\/v2\/media?parent=89362"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.quickheal.com\/blogs\/wp-json\/wp\/v2\/categories?post=89362"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.quickheal.com\/blogs\/wp-json\/wp\/v2\/tags?post=89362"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}