1
- version : 2
1
+ version : 2.1
2
+ parameters :
3
+ run_automatedtesting :
4
+ default : false
5
+ type : boolean
6
+ run_basedeployment :
7
+ default : true
8
+ type : boolean
2
9
defaults : &defaults
3
10
docker :
4
11
- image : circleci/python:2.7-stretch-browsers
5
12
install_dependency : &install_dependency
6
13
name : Installation of build and deployment dependencies.
7
14
command : |
8
- sudo apt install jq
9
- sudo pip install awscli --upgrade
10
- sudo pip install docker-compose
15
+ sudo apt install jq python3-pip
16
+ sudo pip3 install awscli --upgrade
17
+ # sudo pip install docker-compose
11
18
install_deploysuite : &install_deploysuite
12
19
name : Installation of install_deploysuite.
13
20
command : |
@@ -39,6 +46,16 @@ builddeploy_steps: &builddeploy_steps
39
46
./buildenv.sh -e $DEPLOY_ENV -b ${LOGICAL_ENV}-${APPNAME}-deployvar
40
47
source buildenvvar
41
48
./master_deploy.sh -d ECS -e $DEPLOY_ENV -t latest -s ${LOGICAL_ENV}-global-appvar,${LOGICAL_ENV}-${APPNAME}-appvar -i ${APPNAME}
49
+ #testing code changes
50
+ if [[ true ]]; then
51
+ ./buildenv.sh -e $DEPLOY_ENV -b ${LOGICAL_ENV}-qa-v1-appvar
52
+ source buildenvvar
53
+ curl --request POST \
54
+ --url https://circleci.com/api/v2/project/github/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME/pipeline \
55
+ --header "Circle-Token: ${QA_USER_TOKEN}" \
56
+ --header 'content-type: application/json' \
57
+ --data '{"branch":"'"$CIRCLE_BRANCH"'","parameters":{"run_automatedtesting":true , "run_basedeployment": false}}'
58
+ fi
42
59
43
60
44
61
jobs :
62
79
" Run-Newman-Test " :
63
80
docker :
64
81
- image : circleci/node:12
82
+ environment :
83
+ DEPLOY_ENV : " DEV"
84
+ LOGICAL_ENV : " dev"
85
+ APPNAME : " resources-api"
65
86
- image : tray/dynamodb-local
66
87
command : " -inMemory -port 7777"
67
88
- image : elasticsearch:6.8.13
@@ -70,21 +91,29 @@ jobs:
70
91
steps :
71
92
- checkout
72
93
- setup_remote_docker
94
+ - run : *install_dependency
95
+ - run : *install_deploysuite
73
96
- run :
74
97
name : ' newman test'
75
98
command : |
99
+ ./awsconfiguration.sh $DEPLOY_ENV
100
+ source awsenvconf
101
+ ./buildenv.sh -e $DEPLOY_ENV -b ${LOGICAL_ENV}-global-appvar,${LOGICAL_ENV}-${APPNAME}-qa-appvar
102
+ source buildenvvar
76
103
npm i
77
- cd local
78
- cd ..
79
- npm run create-tables:test
80
104
cd mock
81
105
(npm run mock-challenge-api&)
82
106
(NODE_ENV=test npm start&)
83
- npm run test:newman
107
+ npm run test:newman:clear
108
+ npm run test:newman
109
+ npm run test:newman:clear
110
+ - store_artifacts :
111
+ path : ./newman
84
112
85
113
workflows :
86
114
version : 2
87
115
build :
116
+ when : << pipeline.parameters.run_basedeployment >>
88
117
jobs :
89
118
# Development builds are executed on "develop" branch only.
90
119
- " build-dev " :
@@ -93,22 +122,27 @@ workflows:
93
122
branches :
94
123
only :
95
124
- develop
125
+ - dev-circleci
96
126
97
- # Production builds are exectuted only on tagged commits to the
127
+ # Production builds are exectuted only on tagged commits to the testing
98
128
# master branch.
99
129
- " build-prod " :
100
130
context : org-global
101
131
filters :
102
132
branches :
103
133
only : master
104
134
135
+ testingflow :
136
+ when : << pipeline.parameters.run_automatedtesting >>
137
+ jobs :
138
+ - Hold [Performance-Testing] :
139
+ type : approval
105
140
- " Run-Newman-Test " :
106
- context : org-global
141
+ context : org-global
107
142
requires :
108
- - build-dev
109
- - build-prod
143
+ - Hold [Performance-Testing]
110
144
filters :
111
145
branches :
112
146
only :
113
- - automated-postman-testing
114
- - develop
147
+ - develop
148
+ - dev-circleci
0 commit comments