Skip to content
Pulkit Singhal edited this page Sep 16, 2016 · 5 revisions

***Consult this too: ***

Deployment/Release Procedure - Staging

  1. Clone repository and switch to develop branch
  2. Since your work is under development ... make sure package.json has the correct MAJOR.MINOR.PATCH-dev set, other than that there isn't anything to manipulate manually. Our only responsibility is to have MAJOR.MINOR.PATCH-dev set properly.
  3. Prepare image for testing:
  4. Build it: docker build -t shoppinpal/warehouse:staging-vx .
  5. Push it to Docker Hub: docker push shoppinpal/warehouse:staging-vx
  6. Point at the new image in the stackfile for warehouse-stack on cloud.docker.com:
```
web:
  image: 'shoppinpal/warehouse:staging-v1.1.1'
worker-web:
  image: 'shoppinpal/warehouse:staging-v1.1.1'
```
  1. Pause Worker execution from IronWorker and make sure that the already running ones finish running.
  2. Then redeploy warehouse-stack with newly built image and test the application

Deployment/Release Procedure - Production

  1. Clone repository and switch to develop branch
  2. Do the steps for versioning outlined here
  3. If the staging passes successfully - Tag image for production deployment:
docker  tag  shoppinpal/warehouse:staging-vx shoppinpal/warehouse:production-vx
docker push shoppinpal/warehouse:production-vx
docker  tag shoppinpal/warehouse:production-vx shoppinpal/warehouse:production 
docker push shoppinpal/warehouse:production
  1. Pause Worker execution from IronWorker and make sure that the already running ones finish running.
  2. Click redeploy button for following services from the customer's stack:
  3. warehouse-web
  4. warehouse-worker
  5. NOTES: 1. a customer's stack and stackfile are separate from the generic warehouse-stack which is used for testing 2. a customer's stack is setup to deploy from the image tagged aswarehouse:production so in this case we don't need to edit the stackfile.

Rollback Procedure

  1. Change production tag to the old image.
  2. For example, suppose there are 2 tags with image name:
```
shoppinpal/warehouse:production-v1.0
shoppinpal/warehouse:production-v1.1
```
To rollback to previous version download both images to your system via docker pull as below

```
docker pull shoppinpal/warehouse:production-v1.0 shoppinpal/warehouse:production-v1.1
docker tag shoppinpal/warehouse:production-v1.0 shoppinpal/warehouse:production
docker push shoppinpal/warehouse:production
```
  1. Pause Worker execution from IronWorker and make sure that the already running ones finish running.
  2. Click redeploy button for following services from the customer's stack:
  3. warehouse-web
  4. warehouse-worker