Skip to main content

Deploy apps to AWS s3 bucket

App deployments handled via Gitlab CI. Once you publish a change that affecting any of the apps under apps/pm-netbank will be picked app deployment pipelines specifically prepared for pm-netbank applications and as well as pm-netbank version of loader-script.

1. How can I configure my app for deployment

CiCd Documentation Basically follow the previous 👆 documentation nothing has changed until to last part (Creating a jenkins job for deployment) where we use Jenkins to deploy our apps to AWS s3.

Part of migrating Jenkins pm-netbank (https://jenkins.tech.dnb.no/jenkinspmw/) pipelines to Gitlab task (https://dnb-asa.atlassian.net/browse/WEBC-200) we will be using Gitlab Ci to deploy app artifacts to AWS s3.

2. Sounds cool but how can I use it and deploy

First find the pipeline that has been triggered for your change as it shown below in the screenshot. It could be anywhere in Merge request, branches or in commits. Very easy to locate it.

How to deploy figure 1

Click on the pipeline indicator and go to pipeline view.

  1. There you will find stage that creates child deployment pipelines click the arrow and extend it.
  2. Find your from affected app pipelines list and extend. As it's shown in the screenshot below. (Only the pm-netbank apps and loader-script configured for pm-nebank pipelines will be shown there.)
  3. Now you will be seeing manual steps for deployment. You will find deployment jobs for dev, sit, uat and prod environments. As soon as click the Play button the deployment will be triggered and your app artifacts will be deployed the AWS S3 bucket by overriding the previous deployment! ⚠️.

How to deploy figure 2

⚠️⚠️ Be careful when you are deploying make sure you do are deploying to the correct environment. Same as in Jenkins you can make wrong deployments easily.

If you made a wrong click and triggered deployment? you can immediately stop that deployment job by clicking on the stop button. The deployment usually takes 2-3 minutes to complete.

3. Invalidating the cloudfront cache?

After the deployment to s3 is success the cloudfront cache will be invalidated automatically.

4. Rollback?

If you made a wrong deployment you can always rollback to the previous deployments.

Previous deployments can be found here:

Gitlab > Deployment > Environments

4.1 Find the previously deployed job and re trigger again

How to deploy figure 3

4.2 Find the version you want to deploy and trigger it

How to deploy figure 4