1
1
version : 2
2
2
defaults : &defaults
3
- docker :
4
- - image : maven:3.6.1-jdk-8
3
+ docker :
4
+ - image : maven:3.6.1-jdk-8
5
5
6
6
deploy_defaults : &deploy_defaults
7
- docker :
8
- - image : cimg/python:3.10.2
7
+ docker :
8
+ - image : cimg/python:3.10.2
9
9
10
10
install_deploy_dependency : &install_deploy_dependency
11
- name : Installation of build and deployment dependencies.
12
- command : |
13
- pip3 install awscli --upgrade
11
+ name : Installation of build and deployment dependencies.
12
+ command : |
13
+ pip3 install awscli --upgrade
14
+ sudo curl -Lo /usr/local/bin/ecs-cli https://amazon-ecs-cli.s3.amazonaws.com/ecs-cli-linux-amd64-latest
15
+ sudo chmod +x /usr/local/bin/ecs-cli
14
16
15
17
install_dependency : &install_dependency
16
- name : Installation of build dependencies.
17
- command : |
18
- # sed -i '/jessie-updates/d' /etc/apt/sources.list
19
- apt update
20
- apt install -y openssl git zip jq
21
- mkdir ~/awscli
22
- cd ~/awscli
23
- curl "https://s3.amazonaws.com/aws-cli/awscli-bundle-1.18.212.zip" -o "awscli-bundle.zip"
24
- unzip awscli-bundle.zip
25
- ./awscli-bundle/install -i /usr/local/aws -b /usr/local/bin/aws
26
- cd ~/project
18
+ name : Installation of build dependencies.
19
+ command : |
20
+ # sed -i '/jessie-updates/d' /etc/apt/sources.list
21
+ apt update
22
+ apt install -y openssl git zip jq
23
+ mkdir ~/awscli
24
+ cd ~/awscli
25
+ curl "https://s3.amazonaws.com/aws-cli/awscli-bundle-1.18.212.zip" -o "awscli-bundle.zip"
26
+ unzip awscli-bundle.zip
27
+ ./awscli-bundle/install -i /usr/local/aws -b /usr/local/bin/aws
28
+ cd ~/project
27
29
28
30
install_deploysuite : &install_deploysuite
29
- name : Installation of install_deploysuite.
30
- command : |
31
- git clone --branch v1.4.14 https://github.com/topcoder-platform/tc-deploy-scripts ../buildscript
32
- cp ./../buildscript/master_deploy.sh .
33
- cp ./../buildscript/buildenv.sh .
34
- cp ./../buildscript/awsconfiguration.sh .
35
- cp ./../buildscript/buildproperties.sh .
31
+ name : Installation of install_deploysuite.
32
+ command : |
33
+ git clone --branch v1.4.14 https://github.com/topcoder-platform/tc-deploy-scripts ../buildscript
34
+ cp ./../buildscript/master_deploy.sh .
35
+ cp ./../buildscript/buildenv.sh .
36
+ cp ./../buildscript/awsconfiguration.sh .
37
+ cp ./../buildscript/buildproperties.sh .
36
38
37
39
fetch_component_src : &fetch_component_src
38
- name : Installation of fetch_component_src.
39
- command : |
40
- git clone --branch ${GRPC_BRANCH} https://github.com/topcoder-platform/online-review-interface-definition ../online-review-interface-definition
41
- git clone --branch ${COMPONENT_BRANCH} https://github.com/topcoder-platform/tc-online-review-backend ../tc-online-review-backend
42
-
43
- build_components : &build_components
44
- name : Building of components
45
- command : |
46
- cd ../online-review-interface-definition
47
- mvn clean install
48
- cd ../tc-online-review-backend
49
- ./install-third-dep.sh
50
- mvn -Dhttps.protocols=TLSv1.2 -DskipTests=true clean install
51
- cd ~/project
40
+ name : Installation of fetch_component_src.
41
+ command : |
42
+ git clone --branch ${OR_INT_BRANCH} https://github.com/topcoder-platform/online-review-interface-definition ../online-review-interface-definition
43
+ git clone --branch ${PLAT_INT_BRANCH} https://github.com/topcoder-platform/plat-interface-definition.git ../plat-interface-definition
44
+ git clone --branch ${COMPONENT_BRANCH} https://github.com/topcoder-platform/tc-online-review-backend ../tc-online-review-backend
45
+
46
+ build_components : &build_components
47
+ name : Building of components
48
+ command : |
49
+ cd ../online-review-interface-definition
50
+ mvn clean install
51
+ cd ../plat-interface-definition
52
+ mvn clean install
53
+ cd ../tc-online-review-backend
54
+ ./install-third-dep.sh
55
+ mvn -Dhttps.protocols=TLSv1.2 -DskipTests=true clean install
56
+ cd ~/project
52
57
53
58
workspace_persist : &workspace_persist
54
- root : ~/
55
- paths :
56
- - project
59
+ root : ~/
60
+ paths :
61
+ - project
57
62
58
63
workspace_attach : &workspace_attach
59
- at : ./
64
+ at : ./
60
65
61
66
restore_cache_settings_for_build : &restore_cache_settings_for_build
62
- key : tc-autopilot-{{ checksum "~/project/pom.xml" }}
67
+ key : tc-autopilot-{{ checksum "~/project/pom.xml" }}
63
68
64
69
save_cache_settings : &save_cache_settings
65
- paths :
66
- - ~/.m2
67
- key : tc-autopilot-{{ checksum "~/project/pom.xml" }}
68
-
69
- build_steps : &build_steps
70
- # Initialization.
71
- - run : *install_dependency
72
- - checkout
73
- - run : *install_deploysuite
74
- - run : *fetch_component_src
75
- - restore_cache : *restore_cache_settings_for_build
76
- - run : *build_components
77
- - run :
78
- name : " AWS Configuration"
79
- command : |
80
- ./awsconfiguration.sh $BUILD_ENV
81
- source awsenvconf
82
- - run :
83
- name : " Buidling OR file"
84
- command : |
85
- source awsenvconf
86
- ./buildproperties.sh -e $BUILD_ENV -k autopilotv1
87
- # mvn dependency:go-offline
88
- mvn clean package
89
- - save_cache : *save_cache_settings
90
- - persist_to_workspace : *workspace_persist
70
+ paths :
71
+ - ~/.m2
72
+ key : tc-autopilot-{{ checksum "~/project/pom.xml" }}
73
+
74
+ build_steps : &build_steps # Initialization.
75
+ - run : *install_dependency
76
+ - checkout
77
+ - run : *install_deploysuite
78
+ - run : *fetch_component_src
79
+ - restore_cache : *restore_cache_settings_for_build
80
+ - run : *build_components
81
+ - run :
82
+ name : " AWS Configuration"
83
+ command : |
84
+ ./awsconfiguration.sh $BUILD_ENV
85
+ source awsenvconf
86
+ - run :
87
+ name : " Buidling OR file"
88
+ command : |
89
+ source awsenvconf
90
+ ./buildproperties.sh -e $BUILD_ENV -k autopilotv1
91
+ # mvn dependency:go-offline
92
+ mvn clean package
93
+ - save_cache : *save_cache_settings
94
+ - persist_to_workspace : *workspace_persist
91
95
92
96
deploy_steps : &deploy_steps
93
- - attach_workspace : *workspace_attach
94
- - setup_remote_docker
95
- - run : *install_deploy_dependency
96
- - run : *install_deploysuite
97
- - run :
98
- name : Build image
99
- command : |
100
- mv project/* .
101
- ./buildimage.sh ${APPNAME}
102
- - deploy :
103
- name : Running MasterScript.
104
- command : |
105
- ./awsconfiguration.sh $DEPLOY_ENV
106
- source awsenvconf
107
- ./buildenv.sh -e $DEPLOY_ENV -b ${LOGICAL_ENV}-${APPNAME}-deployvar
108
- source buildenvvar
109
- ./master_deploy.sh -d ECS -e $DEPLOY_ENV -t latest -s ${LOGICAL_ENV}-${APPNAME}-appvar -i ${APPNAME}
110
-
111
-
97
+ - attach_workspace : *workspace_attach
98
+ - setup_remote_docker
99
+ - run : *install_deploy_dependency
100
+ - run : *install_deploysuite
101
+ - run :
102
+ name : Build image
103
+ command : |
104
+ mv project/* .
105
+ ./awsconfiguration.sh $DEPLOY_ENV
106
+ source awsenvconf
107
+ ./buildenv.sh -e $DEPLOY_ENV -b ${LOGICAL_ENV}-${APPNAME}-buildvar,${LOGICAL_ENV}-${APPNAME}-deployvar
108
+ source buildenvvar
109
+ ./buildimagev1.sh ${APPNAME}
110
+
111
+ - deploy :
112
+ name : Running MasterScript.
113
+ command : |
114
+ source awsenvconf
115
+ source buildenvvar
116
+ ./master_deploy.sh -d ECS -e $DEPLOY_ENV -m CLI -t latest -i ${APPNAME}
112
117
113
118
jobs :
114
119
# Build & Deploy against development backend
@@ -117,21 +122,36 @@ jobs:
117
122
environment :
118
123
BUILD_ENV : " DEV"
119
124
LOGICAL_ENV : " dev"
120
- COMPONENT_BRANCH : " grpc"
121
- GRPC_BRANCH : " develop"
122
125
DEPLOY_ENV : " DEV"
126
+ COMPONENT_BRANCH : " dev"
127
+ OR_INT_BRANCH : " develop"
128
+ PLAT_INT_BRANCH : " main"
123
129
APPNAME : " tc-autopilot"
124
130
steps : *build_steps
125
131
132
+ " build-qa " :
133
+ << : *defaults
134
+ environment :
135
+ BUILD_ENV : " QA"
136
+ LOGICAL_ENV : " qa"
137
+ DEPLOY_ENV : " QA"
138
+ COMPONENT_BRANCH : " qa"
139
+ OR_INT_BRANCH : " qa"
140
+ PLAT_INT_BRANCH : " main"
141
+ APPNAME : " tc-online-review"
142
+ steps : *build_steps
143
+
126
144
" build-prod " :
127
145
<< : *defaults
128
146
environment :
129
147
BUILD_ENV : " PROD"
130
- LOGICAL_ENV : " prod"
131
- DEPLOY_ENV : " PROD"
132
- COMPONENT_BRANCH : " master"
133
- APPNAME : " tc-autopilot"
134
- steps : *build_steps
148
+ LOGICAL_ENV : " prod"
149
+ DEPLOY_ENV : " PROD"
150
+ COMPONENT_BRANCH : " master"
151
+ OR_INT_BRANCH : " main"
152
+ PLAT_INT_BRANCH : " main"
153
+ APPNAME : " tc-autopilot"
154
+ steps : *build_steps
135
155
136
156
deployDev :
137
157
<< : *deploy_defaults
@@ -141,6 +161,14 @@ jobs:
141
161
APPNAME : " tc-autopilot"
142
162
steps : *deploy_steps
143
163
164
+ deployQa :
165
+ << : *deploy_defaults
166
+ environment :
167
+ DEPLOY_ENV : " QA"
168
+ LOGICAL_ENV : " qa"
169
+ APPNAME : " tc-autopilot"
170
+ steps : *deploy_steps
171
+
144
172
deployProd :
145
173
<< : *deploy_defaults
146
174
environment :
@@ -154,31 +182,45 @@ workflows:
154
182
build :
155
183
jobs :
156
184
- build-dev :
157
- context : org-global
185
+ context : org-global
158
186
filters :
159
187
branches :
160
188
only :
161
189
- dev-maven
162
- - grpc
190
+
191
+ - build-qa :
192
+ context : org-global
193
+ filters :
194
+ branches :
195
+ only :
196
+ - qa-maven
163
197
164
198
- build-prod :
165
- context : org-global
199
+ context : org-global
166
200
filters :
167
201
branches :
168
- only : [ master-maven ]
202
+ only : [master-maven]
169
203
170
204
- deployDev :
171
- context : org-global
205
+ context : org-global
172
206
requires :
173
207
- build-dev
174
- filters :
208
+ filters :
175
209
branches :
176
210
only :
177
211
- dev-maven
178
- - grpc
212
+
213
+ - deployQa :
214
+ context : org-global
215
+ requires :
216
+ - build-qa
217
+ filters :
218
+ branches :
219
+ only :
220
+ - qa-maven
179
221
180
222
- deployProd :
181
- context : org-global
223
+ context : org-global
182
224
requires :
183
225
- build-prod
184
226
filters : &filters-prod
0 commit comments