1. Version Control

Our project is using Git for version control system (VCS) of source code. Currently, we use two branch for deployment process.

Live Branch: master

Dev Branch: develop

After source code transfer, we recommend EZToro team to update Git remote to using EZToro git repository or migrate to another version control system.

2. Deployment Guide

In order to deploy new features to website, please follow this step:

Step 1: Update source code
  • Using Terminal (or other similar tools) to ssh to website server console.









  • Update source code, using git command (update code for branch master) or other VCS tools.

Notes:

  • Website infrastructure have two webnodes, so you must update source code in all webnodes.
  • Please notice about the file permissions of source code inside Magento root folder, we use www-data user for the Magento functionality and ubuntu user for current Git source control.
Step 2:  Clean static asserts

Remove static asserts in EFS file systems, using this following command: 

  • rm -rf /opt/efs/fs1/magento.pub.static/

If you got error in the first webnodes, try to navigate to other webnote to use the same clear static files command.

Step 3: Deploy new version with Ansible

Logout all webnodes server, and ssh to gateway webnode. You will find an Ansible folder for setting up and deploying websites.

Using this following command to deploy all webnodes with Ansible:

  • ansible-playbook -i inventory.ini web-deploy.yml

Waiting for the automation script run and see the results.

Step 4: Error Handling

If you got any error when deploying website, please follow the specific message to detect the error and have the right solution for this. Some common issues: file permissions, composer patch fails, source code does not match between webnodes, setup upgrade version ...

Notes: 

  • You can try to re-deploy with the same steps if the first one fail. But need to revert the pre-processing component to original.
  • If you are not familiar with Ansible automation, please do not edit any script if you don't sure what it's using for. You can use manual deployment instead of Ansible automation script.

3. Manual Deployment

Step 1: Update source code (same as automation deployment)

Step 2 : Clean static asserts (same as automation deployment)

Step 3: Deploy each webnote separately

Deploy each webnode with the following command.  You must cd to the Magento root folder to use.

  • php bin/magento cache:flush
  • php bin/magento setup:upgrade
  • php bin/magento deploy:mode:set production -s
  • php bin/magento setup:di:compile
  • php bin/magento setup:static-content:deploy -j 4 en_US vi_VN

Repeat all the following steps with all webnode that you have.

Notes: Please carefully with the folder in EFS, manual deploy is not recommend in this website infrastructure.



  • No labels