<?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: Milan Dikkumburage</title>
    <description>The latest articles on DEV Community by Milan Dikkumburage (@dikkumburage).</description>
    <link>https://dev.to/dikkumburage</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%2F768368%2Fa36e2c1c-af57-45ea-8bb2-7f515c2a3cb6.png</url>
      <title>DEV Community: Milan Dikkumburage</title>
      <link>https://dev.to/dikkumburage</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/dikkumburage"/>
    <language>en</language>
    <item>
      <title>How to set up CI/CD Pipeline for a node.js app from GITLAB to deploy on WP Engine</title>
      <dc:creator>Milan Dikkumburage</dc:creator>
      <pubDate>Sun, 05 Dec 2021 03:11:22 +0000</pubDate>
      <link>https://dev.to/dikkumburage/how-to-set-up-cicd-pipeline-for-a-nodejs-app-from-gitlab-to-deploy-on-wp-engine-4ne2</link>
      <guid>https://dev.to/dikkumburage/how-to-set-up-cicd-pipeline-for-a-nodejs-app-from-gitlab-to-deploy-on-wp-engine-4ne2</guid>
      <description>&lt;p&gt;WP Engine(&lt;a href="https://wpengine.com/"&gt;https://wpengine.com/&lt;/a&gt;) is a very popular WordPress hosting platform, it has a lot of great features like super simple backups and auto staging site creation and replication.&lt;br&gt;
But still there’s no proper guide for how to implement CICD Pipeline with GITLAB on WP Engine&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Create a deployment pipeline&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In this example, I’ll be using Gitlab, yet the principle applies to any of the major Git hosting services. Before we create a deployment pipeline, let’s consider how we would like it to flow.&lt;/p&gt;

&lt;p&gt;1.A developer works on a feature on their local machine.&lt;br&gt;
2.This developer pushes their code to a development Git repository with a tag.&lt;br&gt;
3.When the feature is ready, a merge request is created to update the dev branch.&lt;br&gt;
4.we can run the pipeline after tag created.&lt;br&gt;
5.I used tag method.beacuse in case if any erros in we could revert back to previous deployment&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Installing Prerequisites&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;1 How to install nodejs (&lt;a href="https://www.digitalocean.com/community/tutorials/how-to-install-node-js-on-ubuntu-20-04"&gt;https://www.digitalocean.com/community/tutorials/how-to-install-node-js-on-ubuntu-20-04&lt;/a&gt;)&lt;br&gt;
I recommend the option 3 .Installing Node Using the Node Version Manager . beacuse you can switch node version anytime in this method.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Install composer (&lt;a href="https://getcomposer.org/download/"&gt;https://getcomposer.org/download/&lt;/a&gt;)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Add the pipeline&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;To get the pipeline created, add a new file to the root of your project named .gitlab-ci.yml. Then populate with this:&lt;/p&gt;

&lt;p&gt;Then you have to add the yml file mention variable in your CICD pipeline variable.&lt;br&gt;
All mention variable are used to run deployment commands.You can modify thoese command according to your deployment.&lt;/p&gt;

&lt;p&gt;========================================================&lt;/p&gt;

&lt;p&gt;image: node:12.16.1&lt;/p&gt;

&lt;p&gt;before_script:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;apt-get update&lt;/li&gt;
&lt;li&gt;apt-get install zip --assume-yes&lt;/li&gt;
&lt;li&gt;mkdir -p ~/.ssh&lt;/li&gt;
&lt;li&gt;echo "$WPENGINE_DEV_PVT_KEY" | tr -d '\r' &amp;gt; ~/.ssh/id_rsa&lt;/li&gt;
&lt;li&gt;chmod 600 ~/.ssh/id_rsa&lt;/li&gt;
&lt;li&gt;eval "$(ssh-agent -s)"&lt;/li&gt;
&lt;li&gt;'echo -e "Host *\n\tStrictHostKeyChecking no\n\n" &amp;gt; ~/.ssh/config'&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;stages:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;QA-CODE&lt;/li&gt;
&lt;li&gt;QA-DB&lt;/li&gt;
&lt;li&gt;STG-CODE&lt;/li&gt;
&lt;li&gt;STG-DB&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;QA-CODE:&lt;br&gt;
  stage: QA-CODE&lt;br&gt;
  script:&lt;br&gt;
    - mkdir -p ~/script&lt;br&gt;
    - echo -e "$QACODE" &amp;gt; ~/script/QACODE.sh&lt;br&gt;
    - echo -n "Deploying to code CMS Server..."&lt;br&gt;
    - ssh-add &amp;lt;(echo "$WPENGINE-DEV-PVT-KEY")&lt;br&gt;
    - zip build.zip * .[^.]* -r&lt;br&gt;
    - scp -P 22 build.zip &lt;a href="mailto:QA-user@QA-wpengineserver.com"&gt;QA-user@QA-wpengineserver.com&lt;/a&gt;:/home/qa/qa_server/qa_cms_tmp/&lt;br&gt;
    - scp -P 22 -o StrictHostKeyChecking=no ~/script/QACODE.sh &lt;a href="mailto:QA-user@QA-wpengineserver.com"&gt;QA-user@QA-wpengineserver.com&lt;/a&gt;:/home/qa/qa_server/script&lt;br&gt;
    - ssh -p 22 -o StrictHostKeyChecking=no &lt;a href="mailto:QA-user@QA-wpengineserver.com"&gt;QA-user@QA-wpengineserver.com&lt;/a&gt; "chmod +x /home/qa/qa_server/script/QACODE.sh"&lt;br&gt;
    - ssh -p 22 -o StrictHostKeyChecking=no &lt;a href="mailto:QA-user@QA-wpengineserver.com"&gt;QA-user@QA-wpengineserver.com&lt;/a&gt; "sh/home/qa/qa_server/script/QACODE.sh"&lt;/p&gt;

&lt;p&gt;only:&lt;br&gt;
    - tags&lt;br&gt;
  when: manual&lt;/p&gt;

&lt;p&gt;QA-DB:&lt;br&gt;
  stage: QA-DB&lt;br&gt;
  script:&lt;br&gt;
    - mkdir -p ~/script&lt;br&gt;
    - echo -e "$QADB" &amp;gt; ~/script/QADB.sh&lt;br&gt;
    - echo -n "Deploying to code CMS Server..."&lt;br&gt;
    - ssh-add &amp;lt;(echo "$WPENGINE-DEV-PVT-KEY")&lt;br&gt;
    - scp -P 22 -o StrictHostKeyChecking=no ~/script/QADB.sh &lt;a href="mailto:QA-user@QA-wpengineserver.com"&gt;QA-user@QA-wpengineserver.com&lt;/a&gt;:/home/qa/qa_server/script&lt;br&gt;
    - ssh -p 22 -o StrictHostKeyChecking=no &lt;a href="mailto:QA-user@QA-wpengineserver.com"&gt;QA-user@QA-wpengineserver.com&lt;/a&gt; "chmod +x /home/qa/qa_server/script/QADB.sh"&lt;br&gt;
    - ssh -p 22 -o StrictHostKeyChecking=no &lt;a href="mailto:QA-user@QA-wpengineserver.com"&gt;QA-user@QA-wpengineserver.com&lt;/a&gt; "sh  /home/qa/qa_server/script/QADB.sh"&lt;/p&gt;

&lt;p&gt;only:&lt;br&gt;
    - tags&lt;br&gt;
  when: manual&lt;/p&gt;

&lt;p&gt;STG-CODE:&lt;br&gt;
  stage: STG-CODE&lt;br&gt;
  script:&lt;br&gt;
    - mkdir -p ~/script&lt;br&gt;
    - echo -e "$STGCODE" &amp;gt; ~/script/STGCODE.sh&lt;br&gt;
    - echo -n "Deploying to code CMS Server..."&lt;br&gt;
    - ssh-add &amp;lt;(echo "$WPENGINE-STG-PVT-KEY")&lt;br&gt;
    - zip build.zip * .[^.]* -r&lt;br&gt;
    - scp -P 22 build.zip &lt;a href="mailto:STG-user@STG-wpengineserver.com"&gt;STG-user@STG-wpengineserver.com&lt;/a&gt;:/home/stg/stg_server/qa_cms_tmp/&lt;br&gt;
    - scp -P 22 -o StrictHostKeyChecking=no ~/script/STGCODE.sh &lt;a href="mailto:QA-user@QA-wpengineserver.com"&gt;QA-user@QA-wpengineserver.com&lt;/a&gt;:/home/stg/stg_server/script&lt;br&gt;
    - ssh -p 22 -o StrictHostKeyChecking=no &lt;a href="mailto:STG-user@STG-wpengineserver.com"&gt;STG-user@STG-wpengineserver.com&lt;/a&gt; "chmod +x /home/stg/stg_server/script/STGCODE.sh"&lt;br&gt;
    - ssh -p 22 -o StrictHostKeyChecking=no &lt;a href="mailto:STG-user@STG-wpengineserver.com"&gt;STG-user@STG-wpengineserver.com&lt;/a&gt; "sh/home/stg/stg_server/script/STGCODE.sh"&lt;/p&gt;

&lt;p&gt;only:&lt;br&gt;
    - tags&lt;br&gt;
  when: manual&lt;/p&gt;

&lt;p&gt;QA-DB:&lt;br&gt;
  stage: STG-DB&lt;br&gt;
  script:&lt;br&gt;
    - mkdir -p ~/script&lt;br&gt;
    - echo -e "$STGDB" &amp;gt; ~/script/STGDB.sh&lt;br&gt;
    - echo -n "Deploying to code CMS Server..."&lt;br&gt;
    - ssh-add &amp;lt;(echo "$WPENGINE-STG-PVT-KEY")&lt;br&gt;
    - scp -P 22 -o StrictHostKeyChecking=no ~/script/STGDB.sh &lt;a href="mailto:STG-user@STG-wpengineserver.com"&gt;STG-user@STG-wpengineserver.com&lt;/a&gt;:/home/stg/stg_server/script&lt;br&gt;
    - ssh -p 22 -o StrictHostKeyChecking=no &lt;a href="mailto:STG-user@STG-wpengineserver.com"&gt;STG-user@STG-wpengineserver.com&lt;/a&gt; "chmod +x /home/stg/stg_server/script/STGDB.sh"&lt;br&gt;
    - ssh -p 22 -o StrictHostKeyChecking=no &lt;a href="mailto:STG-user@STG-wpengineserver.com"&gt;STG-user@STG-wpengineserver.com&lt;/a&gt; "sh  /home/stg/stg_server/script/STGDB.sh"&lt;/p&gt;

&lt;p&gt;only:&lt;br&gt;
    - tags&lt;br&gt;
  when: manual&lt;/p&gt;

&lt;p&gt;========================================================&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;GitHub URL&lt;/strong&gt; &lt;a href="https://github.com/milan-dikkumburage/wpengine-cicd/blob/7c0978ec26461ca941440d07c89c12397185f1b1/mail.yml"&gt;https://github.com/milan-dikkumburage/wpengine-cicd/blob/7c0978ec26461ca941440d07c89c12397185f1b1/mail.yml&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Like, share and follow me 😍 for more content:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.linkedin.com/in/milan-dikkumburage-9480b814b/"&gt;LinkedIn&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Script&lt;/strong&gt; &lt;a href="https://github.com/milan-dikkumburage/wpengine-cicd/tree/dev/script"&gt;https://github.com/milan-dikkumburage/wpengine-cicd/tree/dev/script&lt;/a&gt;&lt;/p&gt;

</description>
      <category>cicd</category>
      <category>bash</category>
      <category>gitlab</category>
      <category>wpengine</category>
    </item>
    <item>
      <title>How to fix ERROR 1153 (08S01) at line 1407: Got a packet bigger than ‘max_allowed_packet’ bytes in amazon RDS</title>
      <dc:creator>Milan Dikkumburage</dc:creator>
      <pubDate>Sun, 05 Dec 2021 03:06:57 +0000</pubDate>
      <link>https://dev.to/dikkumburage/how-to-fix-error-1153-08s01-at-line-1407-got-a-packet-bigger-than-maxallowedpacket-bytes-in-amazon-rds-4ck7</link>
      <guid>https://dev.to/dikkumburage/how-to-fix-error-1153-08s01-at-line-1407-got-a-packet-bigger-than-maxallowedpacket-bytes-in-amazon-rds-4ck7</guid>
      <description>&lt;p&gt;If you got error message when you restore the database to amazon RDS . follow below steps to fix&lt;/p&gt;

&lt;p&gt;Go to the aws console &amp;amp; switch to the RDS panel&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--XfAK7i8S--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/s5dsy6qm97otiz5uoxqj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--XfAK7i8S--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/s5dsy6qm97otiz5uoxqj.png" alt="Image description" width="849" height="458"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click Parameter group . (because you can’t edit the default parameters )&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--r_Bfs-XD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/foucam3xb4wlym04ssom.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--r_Bfs-XD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/foucam3xb4wlym04ssom.png" alt="Image description" width="853" height="460"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then select the parameter that you create and search the key word max_allowed_packet and add the maximum value as 1073741824 ,save it .&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--5wT02pZx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/orok730hc68rqjsg3mnj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--5wT02pZx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/orok730hc68rqjsg3mnj.png" alt="Image description" width="851" height="352"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Like, share and follow me 😍 for more content:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.linkedin.com/in/milan-dikkumburage-9480b814b/"&gt;LinkedIn&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>aws</category>
    </item>
    <item>
      <title>How to send an email using the AWS SES service with Postfix</title>
      <dc:creator>Milan Dikkumburage</dc:creator>
      <pubDate>Sun, 05 Dec 2021 03:01:44 +0000</pubDate>
      <link>https://dev.to/dikkumburage/how-to-send-an-email-using-the-aws-ses-service-with-postfix-35lo</link>
      <guid>https://dev.to/dikkumburage/how-to-send-an-email-using-the-aws-ses-service-with-postfix-35lo</guid>
      <description>&lt;p&gt;The full video is available here: &lt;br&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/Y0QvHbQQXmQ"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;Like, share and follow me 😍 for more content:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.linkedin.com/in/milan-dikkumburage-9480b814b/"&gt;LinkedIn&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>aws</category>
      <category>email</category>
      <category>postfix</category>
    </item>
  </channel>
</rss>
