1- version : 2
1+ version : 2.1
2+ parameters :
3+ run_basedeployment :
4+ default : true
5+ type : boolean
6+ run_smoketesting :
7+ default : false
8+ type : boolean
9+
210defaults : &defaults
311 docker :
412 - image : node:14
13+
514deploy_defaults : &deploy_defaults
615 docker :
716 - image : cibuilds/aws
17+
18+ test_defaults : &test_defaults
19+ docker :
20+ - image : docker:17.11.0-ce-git
21+
822install_dependency : &install_dependency
923 name : Installation of build and deployment dependencies.
1024 command : |
1125 apt update
1226 apt install jq -y
1327 apt install python-dev python-pip -y
1428 pip install awscli --upgrade
29+ install_test_dependency : &install_test_dependency
30+ name : Installation of build and deployment dependencies.
31+ command : |
32+ apk update
33+ apk add --no-cache bash openssl curl
34+ apk upgrade
35+ apk add --no-cache jq py-pip sudo
36+ sudo pip install awscli --upgrade
1537install_deploysuite : &install_deploysuite
1638 name : Installation of install_deploysuite.
1739 command : |
@@ -66,6 +88,36 @@ deploy_steps: &deploy_steps
6688 ./buildenv.sh -e $DEPLOY_ENV -b ${LOGICAL_ENV}-connectapp-deployvar
6789 source buildenvvar
6890 ./master_deploy.sh -d CFRONT -e $DEPLOY_ENV -c $ENABLE_CACHE
91+ curl --request POST \
92+ --url https://circleci.com/api/v2/project/github/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME/pipeline \
93+ --header "Circle-Token: ${CIRCLE_TOKEN}" \
94+ --header 'content-type: application/json' \
95+ --data '{"branch":"'"$CIRCLE_BRANCH"'","parameters":{"run_smoketesting":true, "run_basedeployment": false}}'
96+
97+
98+ # Automated Smoke Testing
99+ smoke_testing : &smoke_testing
100+ # Initialization.
101+ - checkout
102+ - setup_remote_docker
103+ - run : *install_test_dependency
104+ - run : *install_deploysuite
105+ # Restoration of node_modules from cache.
106+ - restore_cache : *restore_cache_settings_for_build
107+ - run :
108+ name : " configuring environment"
109+ command : |
110+ ./awsconfiguration.sh $DEPLOY_ENV
111+ ./buildenv.sh -e $DEPLOY_ENV -b ${LOGICAL_ENV}-connectapp-buildvar
112+ - run :
113+ name : " Run automation"
114+ no_output_timeout : 20m
115+ command : |
116+ source awsenvconf
117+ source buildenvvar
118+ ./connect-automation/smoketest.sh
119+ - store_artifacts :
120+ path : ./connect-automation/test-results
69121
70122jobs :
71123 build-dev :
@@ -107,9 +159,17 @@ jobs:
107159 ENABLE_CACHE : true
108160 steps : *deploy_steps
109161
162+ smoke-testing-dev :
163+ << : *test_defaults
164+ environment :
165+ DEPLOY_ENV : " DEV"
166+ LOGICAL_ENV : " dev"
167+ steps : *smoke_testing
168+
110169workflows :
111170 version : 2
112171 build :
172+ when : << pipeline.parameters.run_basedeployment >>
113173 jobs :
114174 - build-dev :
115175 context : org-global
@@ -126,9 +186,9 @@ workflows:
126186 context : org-global
127187 requires :
128188 - build-dev
129- filters :
189+ filters : &filters-dev
130190 branches :
131- only : ['dev', 'feature/billing_account_protection ']
191+ only : ['dev', 'feature/copilot-feedback ']
132192
133193 - deployTest01 :
134194 context : org-global
@@ -145,3 +205,15 @@ workflows:
145205 filters :
146206 branches :
147207 only : master
208+
209+ Smoke Testing :
210+ when : << pipeline.parameters.run_smoketesting >>
211+ jobs :
212+ - Hold [Smoke-Testing] :
213+ type : approval
214+ - smoke-testing-dev :
215+ context : org-global
216+ requires :
217+ - Hold [Smoke-Testing]
218+ filters :
219+ << : *filters-dev
0 commit comments