{"id":60,"date":"2023-05-20T10:22:49","date_gmt":"2023-05-20T09:22:49","guid":{"rendered":"https:\/\/fabrizio.vanzani.it\/?p=60"},"modified":"2023-05-20T10:22:49","modified_gmt":"2023-05-20T09:22:49","slug":"simple-cli-deploy-commands-for-m2","status":"publish","type":"post","link":"https:\/\/fabrizio.vanzani.it\/?p=60","title":{"rendered":"Simple CLI deploy commands for M2"},"content":{"rendered":"\n<p>On small projects, when you don&#8217;t have a deploy system, these shell aliases are handy.<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" style=\"font-size:.875rem;line-height:1.25rem\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#2e3440ff\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" data-code=\"alias m2='bin\/magento'\nalias dep='m2 maint:en &amp;&amp; git pull &amp;&amp; composer install --no-dev &amp;&amp; m2 setup:upgrade &amp;&amp; rm -r generated\/* &amp;&amp; m2 setup:di:compile &amp;&amp; rm -rf  var\/view_preprocessed\/*  pub\/static\/frontend\/* &amp;&amp; m2 setup:static-content:deploy it_IT en_US -a frontend -f &amp;&amp; m2 ca:cl &amp;&amp; m2 maint:dis &amp;&amp;  m2 setup:static-content:deploy it_IT en_US -a adminhtml -f'\nalias assets='rm -rf  var\/view_preprocessed\/* pub\/static\/frontend\/* &amp;&amp; m2 setup:static-content:deploy it_IT -a frontend -f &amp;&amp; m2 ca:cl '\nalias dicompile='rm -r generated\/* &amp;&amp; m2 setup:di:compile &amp;&amp; m2 ca:cl'\n\" style=\"color:#d8dee9ff;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki nord\" style=\"background-color: #2e3440ff\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #D8DEE9\">alias<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">m2<\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #A3BE8C\">bin\/magento<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9\">alias<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">dep<\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #A3BE8C\">m2 maint:en &amp;&amp; git pull &amp;&amp; composer install --no-dev &amp;&amp; m2 setup:upgrade &amp;&amp; rm -r generated\/* &amp;&amp; m2 setup:di:compile &amp;&amp; rm -rf  var\/view_preprocessed\/*  pub\/static\/frontend\/* &amp;&amp; m2 setup:static-content:deploy it_IT en_US -a frontend -f &amp;&amp; m2 ca:cl &amp;&amp; m2 maint:dis &amp;&amp;  m2 setup:static-content:deploy it_IT en_US -a adminhtml -f<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9\">alias<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">assets<\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #A3BE8C\">rm -rf  var\/view_preprocessed\/* pub\/static\/frontend\/* &amp;&amp; m2 setup:static-content:deploy it_IT -a frontend -f &amp;&amp; m2 ca:cl <\/span><span style=\"color: #ECEFF4\">&#39;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9\">alias<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">dicompile<\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #A3BE8C\">rm -r generated\/* &amp;&amp; m2 setup:di:compile &amp;&amp; m2 ca:cl<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><\/span>\n<span class=\"line\"><\/span><\/code><\/pre><\/div>\n\n\n\n<p>Change the theme languages for your specific project.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>A few cli commands helping deploy new code on a magento 2 environment<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[15,4,7],"tags":[19],"class_list":["post-60","post","type-post","status-publish","format-standard","hentry","category-2-x","category-magento","category-quick-tips","tag-cli"],"_links":{"self":[{"href":"https:\/\/fabrizio.vanzani.it\/index.php?rest_route=\/wp\/v2\/posts\/60","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fabrizio.vanzani.it\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fabrizio.vanzani.it\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fabrizio.vanzani.it\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fabrizio.vanzani.it\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=60"}],"version-history":[{"count":1,"href":"https:\/\/fabrizio.vanzani.it\/index.php?rest_route=\/wp\/v2\/posts\/60\/revisions"}],"predecessor-version":[{"id":61,"href":"https:\/\/fabrizio.vanzani.it\/index.php?rest_route=\/wp\/v2\/posts\/60\/revisions\/61"}],"wp:attachment":[{"href":"https:\/\/fabrizio.vanzani.it\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=60"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fabrizio.vanzani.it\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=60"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fabrizio.vanzani.it\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=60"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}