{"id":62579,"date":"2024-07-15T14:59:28","date_gmt":"2024-07-15T09:29:28","guid":{"rendered":"https:\/\/www.tothenew.com\/blog\/?p=62579"},"modified":"2024-07-15T15:01:13","modified_gmt":"2024-07-15T09:31:13","slug":"ultimate-guide-to-deploying-code-on-adobe-commerce-cloud","status":"publish","type":"post","link":"https:\/\/www.tothenew.com\/blog\/ultimate-guide-to-deploying-code-on-adobe-commerce-cloud\/","title":{"rendered":"Ultimate Guide to Deploying Code on Adobe Commerce Cloud"},"content":{"rendered":"<p>Our <span style=\"font-weight: 400;\"><a href=\"https:\/\/www.tothenew.com\/blog\/setup-adobe-commerce-on-cloud\/\">previous blog<\/a><\/span> detailed the process of setting up our environment for code deployment. In this blog, we will focus on how to deploy code changes. To avoid straying from our main topic, we will not demonstrate the development of the module. Instead, we will use a premade custom module as an example.<\/p>\n<h2>Local Development and Testing<\/h2>\n<p><span style=\"font-weight: 400;\">As we mentioned, in our previous blog, you can create a directory of your own choice and install the Magento. Let\u2019s say we named the directory\u00a0 <\/span><b><i>ttn-local-env. <\/i><\/b><span style=\"font-weight: 400;\">\u00a0The next steps would be,<\/span><\/p>\n<ol>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">To develop a new module. (We developed a simple module for demo purposes, which displays the text \u201cHello from TTN Team!!!\u201d)<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Once you are ready with the code to deploy, build and deploy it on the local magento server using the following commands,<\/span><\/li>\n<\/ol>\n<pre><i><span style=\"font-weight: 400;\">php bin\/magento setup:upgrade\r\nphp bin\/magento cache:flush<\/span><\/i><\/pre>\n<p><span style=\"font-weight: 400;\">You should be able to see the changes you developed.<\/span><\/p>\n<div id=\"attachment_62576\" style=\"width: 635px\" class=\"wp-caption alignnone\"><img aria-describedby=\"caption-attachment-62576\" decoding=\"async\" loading=\"lazy\" class=\"wp-image-62576 size-large\" src=\"https:\/\/www.tothenew.com\/blog\/wp-ttn-blog\/uploads\/2024\/06\/Screenshot-from-2024-06-25-12-17-54-1024x531.png\" alt=\"Local Env\" width=\"625\" height=\"324\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2024\/06\/Screenshot-from-2024-06-25-12-17-54-1024x531.png 1024w, \/blog\/wp-ttn-blog\/uploads\/2024\/06\/Screenshot-from-2024-06-25-12-17-54-300x155.png 300w, \/blog\/wp-ttn-blog\/uploads\/2024\/06\/Screenshot-from-2024-06-25-12-17-54-768x398.png 768w, \/blog\/wp-ttn-blog\/uploads\/2024\/06\/Screenshot-from-2024-06-25-12-17-54-1536x796.png 1536w, \/blog\/wp-ttn-blog\/uploads\/2024\/06\/Screenshot-from-2024-06-25-12-17-54-624x323.png 624w, \/blog\/wp-ttn-blog\/uploads\/2024\/06\/Screenshot-from-2024-06-25-12-17-54.png 1692w\" sizes=\"(max-width: 625px) 100vw, 625px\" \/><p id=\"caption-attachment-62576\" class=\"wp-caption-text\">Local Env<\/p><\/div>\n<h2>Sync the Cloud Dev environment<\/h2>\n<p><span style=\"font-weight: 400;\">If the changes on the local dev environment look good, we can bring the cloud dev server up to sync.<\/span> <span style=\"font-weight: 400;\">We have developed our code in <\/span><b>ttn-local-env<\/b><span style=\"font-weight: 400;\"> directory, to commit and push the changes\u00a0<\/span><\/p>\n<ol>\n<li><span style=\"font-weight: 400;\">We will copy over only the changed code files to the <\/span><b><i>dev<\/i><\/b><span style=\"font-weight: 400;\"> (under \/<\/span><i><span style=\"font-weight: 400;\">var\/www\/html\/&lt;cloud-folder&gt;<\/span><\/i><span style=\"font-weight: 400;\">) directory.\u00a0<\/span><\/li>\n<li><span style=\"font-weight: 400;\">Commit and push the changes on the <\/span><b><i>dev<\/i><\/b><span style=\"font-weight: 400;\"> branch.\u00a0<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Test and verify the same changes on the cloud dev environment too.<\/span><\/li>\n<\/ol>\n<h2>Progress the changes to higher environments<\/h2>\n<p>Now that you have validated the changes and are ready for a higher environment. Let\u2019s go ahead and push the changes on the Stage.<\/p>\n<ol>\n<li>To merge the dev changes, we will first checkout on the Stage branch, and take a pull of the dev branch.<\/li>\n<li>Finally using the <em>git push<\/em> command we will deploy the changes on the Stage environment.<\/li>\n<\/ol>\n<p>Similarly, the same steps are to be followed for the Master environment and the Master branch. The only difference in this case would be that, instead of merging the dev branch to the master branch, you will merge the stage branch to the master. And use the same git push command to deploy the master branch.<\/p>\n<p>After doing those changes, your changes will be live, and you can verify them on the master environment.<\/p>\n<div id=\"attachment_62580\" style=\"width: 635px\" class=\"wp-caption alignnone\"><img aria-describedby=\"caption-attachment-62580\" decoding=\"async\" loading=\"lazy\" class=\"size-large wp-image-62580\" src=\"https:\/\/www.tothenew.com\/blog\/wp-ttn-blog\/uploads\/2024\/06\/master-env-1024x681.png\" alt=\"Master Env\" width=\"625\" height=\"416\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2024\/06\/master-env-1024x681.png 1024w, \/blog\/wp-ttn-blog\/uploads\/2024\/06\/master-env-300x199.png 300w, \/blog\/wp-ttn-blog\/uploads\/2024\/06\/master-env-768x511.png 768w, \/blog\/wp-ttn-blog\/uploads\/2024\/06\/master-env-624x415.png 624w, \/blog\/wp-ttn-blog\/uploads\/2024\/06\/master-env.png 1450w\" sizes=\"(max-width: 625px) 100vw, 625px\" \/><p id=\"caption-attachment-62580\" class=\"wp-caption-text\">Master Env<\/p><\/div>\n<p><span style=\"font-weight: 400;\">With this, we conclude with our deployment and 2 part blog series where in the first part we covered how to set up Adobe Commerce on the Cloud. And, in the second part, we saw how we can deploy the code changes.<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Our previous blog detailed the process of setting up our environment for code deployment. In this blog, we will focus on how to deploy code changes. To avoid straying from our main topic, we will not demonstrate the development of the module. Instead, we will use a premade custom module as an example. Local Development [&hellip;]<\/p>\n","protected":false},"author":1383,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":19},"categories":[5868],"tags":[1522,5059,5116,1916],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/62579"}],"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\/1383"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/comments?post=62579"}],"version-history":[{"count":6,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/62579\/revisions"}],"predecessor-version":[{"id":63111,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/62579\/revisions\/63111"}],"wp:attachment":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/media?parent=62579"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/categories?post=62579"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/tags?post=62579"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}