From 6d222d8c4dd609bd7b21af6121e256fd66590158 Mon Sep 17 00:00:00 2001 From: "Luiz R. Rodrigues" Date: Tue, 1 Jun 2021 06:10:50 -0300 Subject: [PATCH 1/5] Fix CircleCI deployment --- .circleci/config.yml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 66156c3f8c..31416d386e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -47,7 +47,7 @@ build_docker_image: &build_docker_image ./build.sh jobs: # Build & Deploy against development backend - deployDev: + "build-dev": <<: *defaults steps: # Initialization. @@ -74,7 +74,7 @@ jobs: source buildenvvar ./master_deploy.sh -d ECS -e DEV -t latest -s dev_communityapp_taskvar -i communityapp # Build & Deploy against testing backend - deployTest: + "build-test": <<: *defaults steps: # Initialization. @@ -101,7 +101,7 @@ jobs: source buildenvvar ./master_deploy.sh -d ECS -e DEV -t latest -s test_communityapp_taskvar -i communityapp # Build & Deploy against testing backend - deployQA: + "build-qa": <<: *defaults steps: # Initialization. @@ -128,7 +128,7 @@ jobs: source buildenvvar ./master_deploy.sh -d ECS -e DEV -t latest -s qa_communityapp_taskvar -i communityapp # Build & Deploy against prod api backend - deployBeta: + "build-prod-beta": <<: *defaults steps: # Initialization. @@ -156,7 +156,7 @@ jobs: ./master_deploy.sh -d ECS -e PROD -t latest -s beta_communityapp_taskvar, -i communityapp # Build & Deploy against prod api backend - deployStag: + "build-prod-staging": <<: *defaults steps: # Initialization. @@ -189,7 +189,7 @@ jobs: --data '{"branch":"'"$CIRCLE_BRANCH"'","parameters":{"run_smoketesting":true , "run_performancetesting":false, "run_basedeployment": false}}' # Build & Deploy against production backend - deployProd: + "build-prod": <<: *defaults steps: # Initialization. @@ -327,35 +327,35 @@ workflows: when: << pipeline.parameters.run_basedeployment >> jobs: # Development builds are executed on "new-develop" branch only. - - deployDev: + - "build-dev": context : org-global filters: branches: only: - develop # This is alternate dev env for parallel testing - - deployTest: + - "build-test": context : org-global filters: branches: only: - free # This is alternate dev env for parallel testing - - deployQA: + - "build-qa": context : org-global filters: branches: only: - free # This is beta env for production soft releases - - deployBeta: + - "build-prod-beta": context : org-global filters: branches: only: - free # This is stage env for production QA releases - - deployStag: + - "build-prod-staging": context : org-global filters: branches: @@ -367,7 +367,7 @@ workflows: # That might trigger wrong branch to be # deployed on the production # master branch. - - deployProd: + - "build-prod": context : org-global filters: branches: From 265cc9443496a5efa9b6685eec08c768af892f4d Mon Sep 17 00:00:00 2001 From: "Luiz R. Rodrigues" Date: Tue, 1 Jun 2021 06:11:58 -0300 Subject: [PATCH 2/5] Only run AST in master and develop branches --- .circleci/config.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 31416d386e..57026564dd 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -382,7 +382,12 @@ workflows: - develop Smoke Testing: - when: << pipeline.parameters.run_smoketesting >> + when: + and: + - << pipeline.parameters.run_smoketesting >> + - or: + - equal: [ develop, << pipeline.git.branch >> ] + - equal: [ master, << pipeline.git.branch >> ] jobs: - Hold [Smoke-Testing]: type: approval From 04a2ebe5c0c121cca7093019326eee62d1512875 Mon Sep 17 00:00:00 2001 From: "Luiz R. Rodrigues" Date: Tue, 1 Jun 2021 06:13:21 -0300 Subject: [PATCH 3/5] ci: Deploy fix-circleci-deployment to Stag env --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 57026564dd..0f783c47e0 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -361,6 +361,7 @@ workflows: branches: only: - develop + - fix-circleci-deployment # Production builds are exectuted # when PR is merged to the master # Don't change anything in this configuration From fd7b88406cd3f8aefbe4d211c4729248e2b61a41 Mon Sep 17 00:00:00 2001 From: "Luiz R. Rodrigues" Date: Tue, 1 Jun 2021 07:51:40 -0300 Subject: [PATCH 4/5] ci: Fix Automated Smoke Testing flow --- .circleci/config.yml | 33 +++++++++++++-------------------- 1 file changed, 13 insertions(+), 20 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 0f783c47e0..5e5eb2b621 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -3,9 +3,6 @@ parameters: run_basedeployment: default: true type: boolean - run_smoketesting: - default: false - type: boolean run_performancetesting: default: false type: boolean @@ -73,6 +70,7 @@ jobs: source awsenvconf source buildenvvar ./master_deploy.sh -d ECS -e DEV -t latest -s dev_communityapp_taskvar -i communityapp + # Build & Deploy against testing backend "build-test": <<: *defaults @@ -100,6 +98,7 @@ jobs: source awsenvconf source buildenvvar ./master_deploy.sh -d ECS -e DEV -t latest -s test_communityapp_taskvar -i communityapp + # Build & Deploy against testing backend "build-qa": <<: *defaults @@ -127,6 +126,7 @@ jobs: source awsenvconf source buildenvvar ./master_deploy.sh -d ECS -e DEV -t latest -s qa_communityapp_taskvar -i communityapp + # Build & Deploy against prod api backend "build-prod-beta": <<: *defaults @@ -182,11 +182,6 @@ jobs: source awsenvconf source buildenvvar ./master_deploy.sh -d ECS -e PROD -t latest -s staging_communityapp_taskvar, -i communityapp - curl --request POST \ - --url https://circleci.com/api/v2/project/github/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME/pipeline \ - --header "Circle-Token: ${CIRCLE_TOKEN}" \ - --header 'content-type: application/json' \ - --data '{"branch":"'"$CIRCLE_BRANCH"'","parameters":{"run_smoketesting":true , "run_performancetesting":false, "run_basedeployment": false}}' # Build & Deploy against production backend "build-prod": @@ -215,11 +210,8 @@ jobs: source awsenvconf source buildenvvar ./master_deploy.sh -d ECS -e PROD -t latest -s prod_communityapp_taskvar -i communityapp - curl --request POST \ - --url https://circleci.com/api/v2/project/github/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME/pipeline \ - --header "Circle-Token: ${CIRCLE_TOKEN}" \ - --header 'content-type: application/json' \ - --data '{"branch":"'"$CIRCLE_BRANCH"'","parameters":{"run_smoketesting":true , "run_performancetesting":false, "run_basedeployment": false}}' + + # Automated Smoke Testing against Staging Smoke-Testing-On-Staging: <<: *defaults steps: @@ -244,6 +236,8 @@ jobs: ./automated-smoke-test/smoketest.sh automation-config-staging.json prod - store_artifacts: path: /automated-smoke-test/test-results + + # Automated Smoke Testing against Production Smoke-Testing-On-Production: <<: *defaults steps: @@ -266,6 +260,7 @@ jobs: source awsenvconf source buildenvvar ./automated-smoke-test/smoketest.sh automation-config-prod.json prod + # Test job for the cases when we do not need deployment. It just rapidly # installs (updates) app dependencies, and runs tests (ESLint, Stylelint, # Jest unit-tests). @@ -282,7 +277,7 @@ jobs: paths: - node_modules - run: npm test - + Performance-Testing: docker: # specify the version you desire here @@ -320,7 +315,7 @@ jobs: - store_artifacts: path: target/jmeter/reports - + workflows: version: 2 Build: @@ -384,11 +379,9 @@ workflows: Smoke Testing: when: - and: - - << pipeline.parameters.run_smoketesting >> - - or: - - equal: [ develop, << pipeline.git.branch >> ] - - equal: [ master, << pipeline.git.branch >> ] + or: + - equal: [ develop, << pipeline.git.branch >> ] + - equal: [ master, << pipeline.git.branch >> ] jobs: - Hold [Smoke-Testing]: type: approval From 1fb2235df3a5c55b635a4a7b99302e881c9fda61 Mon Sep 17 00:00:00 2001 From: "Luiz R. Rodrigues" Date: Tue, 1 Jun 2021 08:20:05 -0300 Subject: [PATCH 5/5] ci: User yaml anchor to filter automated smoke testing --- .circleci/config.yml | 40 ++++++++++++++++++++++++---------------- 1 file changed, 24 insertions(+), 16 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 5e5eb2b621..67e7cc1fcc 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -3,6 +3,9 @@ parameters: run_basedeployment: default: true type: boolean + run_smoketesting: + default: false + type: boolean run_performancetesting: default: false type: boolean @@ -182,6 +185,11 @@ jobs: source awsenvconf source buildenvvar ./master_deploy.sh -d ECS -e PROD -t latest -s staging_communityapp_taskvar, -i communityapp + curl --request POST \ + --url https://circleci.com/api/v2/project/github/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME/pipeline \ + --header "Circle-Token: ${CIRCLE_TOKEN}" \ + --header 'content-type: application/json' \ + --data '{"branch":"'"$CIRCLE_BRANCH"'","parameters":{"run_smoketesting":true , "run_performancetesting":false, "run_basedeployment": false}}' # Build & Deploy against production backend "build-prod": @@ -210,7 +218,12 @@ jobs: source awsenvconf source buildenvvar ./master_deploy.sh -d ECS -e PROD -t latest -s prod_communityapp_taskvar -i communityapp - + curl --request POST \ + --url https://circleci.com/api/v2/project/github/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME/pipeline \ + --header "Circle-Token: ${CIRCLE_TOKEN}" \ + --header 'content-type: application/json' \ + --data '{"branch":"'"$CIRCLE_BRANCH"'","parameters":{"run_smoketesting":true , "run_performancetesting":false, "run_basedeployment": false}}' + # Automated Smoke Testing against Staging Smoke-Testing-On-Staging: <<: *defaults @@ -236,8 +249,8 @@ jobs: ./automated-smoke-test/smoketest.sh automation-config-staging.json prod - store_artifacts: path: /automated-smoke-test/test-results - - # Automated Smoke Testing against Production + + # Automated Smoke Testing against Production Smoke-Testing-On-Production: <<: *defaults steps: @@ -277,7 +290,7 @@ jobs: paths: - node_modules - run: npm test - + Performance-Testing: docker: # specify the version you desire here @@ -315,7 +328,7 @@ jobs: - store_artifacts: path: target/jmeter/reports - + workflows: version: 2 Build: @@ -352,7 +365,7 @@ workflows: # This is stage env for production QA releases - "build-prod-staging": context : org-global - filters: + filters: &filters-staging branches: only: - develop @@ -365,7 +378,7 @@ workflows: # master branch. - "build-prod": context : org-global - filters: + filters: &filters-prod branches: only: - master @@ -379,9 +392,8 @@ workflows: Smoke Testing: when: - or: - - equal: [ develop, << pipeline.git.branch >> ] - - equal: [ master, << pipeline.git.branch >> ] + and: + - << pipeline.parameters.run_smoketesting >> jobs: - Hold [Smoke-Testing]: type: approval @@ -390,17 +402,13 @@ workflows: requires: - Hold [Smoke-Testing] filters: - branches: - only: - - develop + <<: *filters-staging - Smoke-Testing-On-Production: context : org-global requires: - Hold [Smoke-Testing] filters: - branches: - only: - - master + <<: *filters-prod Performance Testing: when: << pipeline.parameters.run_performancetesting >>