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
+
2
10
defaults : &defaults
3
11
docker :
4
12
- image : node:14
13
+
5
14
deploy_defaults : &deploy_defaults
6
15
docker :
7
16
- image : cibuilds/aws
17
+
18
+ test_defaults : &test_defaults
19
+ docker :
20
+ - image : docker:17.11.0-ce-git
21
+
8
22
install_dependency : &install_dependency
9
23
name : Installation of build and deployment dependencies.
10
24
command : |
11
25
apt update
12
26
apt install jq -y
13
27
apt install python-dev python-pip -y
14
28
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
15
37
install_deploysuite : &install_deploysuite
16
38
name : Installation of install_deploysuite.
17
39
command : |
@@ -66,6 +88,36 @@ deploy_steps: &deploy_steps
66
88
./buildenv.sh -e $DEPLOY_ENV -b ${LOGICAL_ENV}-connectapp-deployvar
67
89
source buildenvvar
68
90
./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
69
121
70
122
jobs :
71
123
build-dev :
@@ -107,9 +159,17 @@ jobs:
107
159
ENABLE_CACHE : true
108
160
steps : *deploy_steps
109
161
162
+ smoke-testing-dev :
163
+ << : *test_defaults
164
+ environment :
165
+ DEPLOY_ENV : " DEV"
166
+ LOGICAL_ENV : " dev"
167
+ steps : *smoke_testing
168
+
110
169
workflows :
111
170
version : 2
112
171
build :
172
+ when : << pipeline.parameters.run_basedeployment >>
113
173
jobs :
114
174
- build-dev :
115
175
context : org-global
@@ -126,9 +186,9 @@ workflows:
126
186
context : org-global
127
187
requires :
128
188
- build-dev
129
- filters :
189
+ filters : &filters-dev
130
190
branches :
131
- only : ['dev', 'feature/billing_account_protection ']
191
+ only : ['dev', 'feature/copilot-feedback ']
132
192
133
193
- deployTest01 :
134
194
context : org-global
@@ -145,3 +205,15 @@ workflows:
145
205
filters :
146
206
branches :
147
207
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