Deploy in a production environment
Edit on GitHubThis document describes how to deploy an application to ECS cluster in a production environment.
Prerequisites
We use the spryker-prod environment as an example. Adjust the name according to your project name.
In this document, an application version is a Git commit hash string which is set as a Docker Image tag for all Elastic Container Registry (ECR) repositories for the environment.
Example of Git commit hash: 290b955bd06d029c8643c093b58a0cedb86b1c8d
Example of the ECR images with the application version in tags:
spryker-prod-b2c-yves:290b955bd06d029c8643c093b58a0cedb86b1c8d
spryker-prod-b2c-zed:290b955bd06d029c8643c093b58a0cedb86b1c8d
spryker-prod-b2c-glue:290b955bd06d029c8643c093b58a0cedb86b1c8d
spryker-prod-frontend:290b955bd06d029c8643c093b58a0cedb86b1c8d
spryker-prod-jenkins:290b955bd06d029c8643c093b58a0cedb86b1c8d
1. Check the version to deploy
To deploy a specific application version, copy the version of the respective GitHub commit:
2. Define the version to deploy
-
In the AWS Management Console, go to Services > Systems Manager > Application Management > Parameter Store.
-
Click /spryker-prod/desired_version.
-
Click Edit.
-
Enter the application version into the Value field.
-
Click Save changes.
3. Run a deployment pipeline
-
In the AWS Management Console, go to Services > CodePipeline.
-
Click NORMAL_Deploy_Spryker_spryker-prod.
Normal deploy is a pipeline that includes all the stages of a complete CI/CD flow. The Install stage of this pipeline does not perform any dangerous data manipulations like database cleanup or scheduler reset. We recommend this type of deploy for production environments.
-
Optional: check the deployed application version and the application version to be deployed:
- In the Prepare_versions_information_for_Approval_stage stage, click Details.
- Click Tail logs and check the job output.
- Check
Deploymnet version
andLatest deployed version
in the output.
-
To approve the application version to be deployed, in the Please_approve stage, click Review.
-
Review the details and click Approve.
-
Click Release change.
If the deployment is successful, the /spryker-prod/last_deployed_version parameter in the Parameter Store is updated with the application version you’ve deployed.
Check the deployed application version
To check the deployed application version in the ECS cluster, follow the steps:
- In the AWS Management Console, go to Services > Elastic Container Service.
- Click spryker-prod.
- Click one of the following services:
- spryker-prod-storeapp
- spryker-prod-backoffice
- spryker-prod-frontend
- spryker-prod-zed
- spryker-prod-yves
-
Go to the Tasks tab.
-
Click the task.
- In the Image column of the Containers section, ensure that the image name of the container contains the correct application version.
Roll back an application
-
Find out the application version you want to roll back to. See 1. Check the version to deploy for more details.
-
In Parameter Store, set the application version as the value of the /spryker-staging/desired_version parameter. See 2. Define the version to deploy for more details.
-
Run a deployment pipeline as described in 3. Run a deployment pipeline.
Thank you!
For submitting the form