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