@@ -7,8 +7,8 @@ parameters:
7
7
default : true
8
8
type : boolean
9
9
defaults : &defaults
10
- docker :
11
- - image : circleci/python:2.7-stretch-browsers
10
+ docker :
11
+ - image : circleci/python:2.7-stretch-browsers
12
12
install_dependency : &install_dependency
13
13
name : Installation of build and deployment dependencies.
14
14
command : |
@@ -28,120 +28,104 @@ restore_cache_settings_for_build: &restore_cache_settings_for_build
28
28
save_cache_settings : &save_cache_settings
29
29
key : docker-node-modules-{{ checksum "package-lock.json" }}
30
30
paths :
31
- - node_modules
31
+ - node_modules
32
32
33
33
builddeploy_steps : &builddeploy_steps
34
- - checkout
35
- - setup_remote_docker
36
- - run : *install_dependency
37
- - run : *install_deploysuite
38
- - restore_cache : *restore_cache_settings_for_build
39
- - run : ./build.sh ${APPNAME}
40
- - save_cache : *save_cache_settings
41
- - deploy :
42
- name : Running MasterScript.
43
- command : |
44
- ./awsconfiguration.sh $DEPLOY_ENV
45
- source awsenvconf
46
- ./buildenv.sh -e $DEPLOY_ENV -b ${LOGICAL_ENV}-${APPNAME}-deployvar
47
- source buildenvvar
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
59
-
60
-
34
+ - checkout
35
+ - setup_remote_docker
36
+ - run : *install_dependency
37
+ - run : *install_deploysuite
38
+ - restore_cache : *restore_cache_settings_for_build
39
+ - run : ./build.sh ${APPNAME}
40
+ - save_cache : *save_cache_settings
41
+ - deploy :
42
+ name : Running MasterScript.
43
+ command : " ./awsconfiguration.sh $DEPLOY_ENV\n source awsenvconf\n ./buildenv.sh -e $DEPLOY_ENV -b ${LOGICAL_ENV}-${APPNAME}-deployvar\n source buildenvvar\n ./master_deploy.sh -d ECS -e $DEPLOY_ENV -t latest -s ${LOGICAL_ENV}-global-appvar,${LOGICAL_ENV}-${APPNAME}-appvar -i ${APPNAME}\n #testing code changes\n if [[ true ]]; then\n ./buildenv.sh -e $DEPLOY_ENV -b ${LOGICAL_ENV}-qa-v1-appvar\n source buildenvvar \n curl --request POST \\\n --url https://circleci.com/api/v2/project/github/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME/pipeline \\\n --header \" Circle-Token: ${QA_USER_TOKEN}\" \\\n --header 'content-type: application/json' \\\n --data '{\" branch\" :\" '\" $CIRCLE_BRANCH\" '\" ,\" parameters\" :{\" run_automatedtesting\" :true , \" run_basedeployment\" : false}}'\n fi \n #magic___^_^___line\n #magic___^_^___line\n "
61
44
jobs :
62
45
# Build & Deploy against development backend
63
46
" build-dev " :
64
- << : *defaults
47
+ !!merge <<: *defaults
65
48
environment :
66
49
DEPLOY_ENV : " DEV"
67
50
LOGICAL_ENV : " dev"
68
- APPNAME : " resources-api"
51
+ APPNAME : " resources-api"
69
52
steps : *builddeploy_steps
70
53
71
54
" build-prod " :
72
- << : *defaults
55
+ !!merge <<: *defaults
73
56
environment :
74
57
DEPLOY_ENV : " PROD"
75
- LOGICAL_ENV : " prod"
76
- APPNAME : " resources-api"
58
+ LOGICAL_ENV : " prod"
59
+ APPNAME : " resources-api"
77
60
steps : *builddeploy_steps
78
61
79
62
" Run-Newman-Test " :
80
63
docker :
81
- - image : circleci/node:12
82
- environment :
83
- DEPLOY_ENV : " DEV"
84
- LOGICAL_ENV : " dev"
85
- APPNAME : " resources-api"
86
- - image : tray/dynamodb-local
87
- command : " -inMemory -port 7777"
88
- - image : elasticsearch:6.8.13
89
- environment :
90
- discovery.type : " single-node"
64
+ - image : circleci/node:12
65
+ environment :
66
+ DEPLOY_ENV : " DEV"
67
+ LOGICAL_ENV : " dev"
68
+ APPNAME : " resources-api"
69
+ - image : tray/dynamodb-local
70
+ command : " -inMemory -port 7777"
71
+ - image : elasticsearch:6.8.13
72
+ environment :
73
+ discovery.type : " single-node"
91
74
steps :
92
- - checkout
93
- - setup_remote_docker
94
- - run : *install_dependency
95
- - run : *install_deploysuite
96
- - run :
97
- name : ' newman test'
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
103
- npm i
104
- cd mock
105
- (npm run mock-challenge-api&)
106
- (NODE_ENV=test npm start&)
107
- npm run test:newman:clear
108
- npm run test:newman
109
- npm run test:newman:clear
110
- - store_artifacts :
111
- path : ./newman
75
+ - checkout
76
+ - setup_remote_docker
77
+ - run : *install_dependency
78
+ - run : *install_deploysuite
79
+ - run :
80
+ name : ' newman test'
81
+ command : |
82
+ ./awsconfiguration.sh $DEPLOY_ENV
83
+ source awsenvconf
84
+ ./buildenv.sh -e $DEPLOY_ENV -b ${LOGICAL_ENV}-global-appvar,${LOGICAL_ENV}-${APPNAME}-qa-appvar
85
+ source buildenvvar
86
+ npm i
87
+ cd mock
88
+ (npm run mock-challenge-api&)
89
+ (NODE_ENV=test npm start&)
90
+ npm run test:newman:clear
91
+ npm run test:newman
92
+ npm run test:newman:clear
93
+ - store_artifacts :
94
+ path : ./newman
112
95
113
96
workflows :
114
97
version : 2
115
98
build :
116
99
when : << pipeline.parameters.run_basedeployment >>
117
100
jobs :
118
- # Development builds are executed on "develop" branch only.
119
- - " build-dev " :
120
- context : org-global
121
- filters :
122
- branches :
123
- only :
124
- - develop
101
+ # Development builds are executed on "develop" branch only.
102
+ - " build-dev " :
103
+ context : org-global
104
+ filters :
105
+ branches :
106
+ only :
107
+ - develop
108
+ - feature/scroll-search
125
109
126
- # Production builds are exectuted only on tagged commits to the testing
127
- # master branch.
128
- - " build-prod " :
129
- context : org-global
130
- filters :
131
- branches :
132
- only : master
110
+ # Production builds are exectuted only on tagged commits to the testing
111
+ # master branch.
112
+ - " build-prod " :
113
+ context : org-global
114
+ filters :
115
+ branches :
116
+ only : master
133
117
134
118
testingflow :
135
119
when : << pipeline.parameters.run_automatedtesting >>
136
120
jobs :
137
- - Hold [Performance-Testing] :
138
- type : approval
139
- - " Run-Newman-Test " :
140
- context : org-global
141
- requires :
142
- - Hold [Performance-Testing]
143
- filters :
144
- branches :
145
- only :
146
- - develop
147
- - dev-circleci
121
+ - Hold [Performance-Testing] :
122
+ type : approval
123
+ - " Run-Newman-Test " :
124
+ context : org-global
125
+ requires :
126
+ - Hold [Performance-Testing]
127
+ filters :
128
+ branches :
129
+ only :
130
+ - develop
131
+ - dev-circleci
0 commit comments