Skip to content

Commit 919b10a

Browse files
authored
Merge pull request #255 from topcoder-platform/dev-maven
dev
2 parents 5b6b0f3 + 143877c commit 919b10a

37 files changed

+525
-1690
lines changed

.circleci/config.yml

Lines changed: 172 additions & 120 deletions
Original file line numberDiff line numberDiff line change
@@ -1,131 +1,145 @@
11
version: 2
22
defaults: &defaults
3-
docker:
4-
- image: maven:3.6.1-jdk-8
3+
docker:
4+
- image: maven:3.6.1-jdk-8
55

66
deploy_defaults: &deploy_defaults
7-
docker:
8-
- image: cimg/python:3.10.2
7+
docker:
8+
- image: cimg/python:3.10.2
99

1010
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
1417
1518
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
3033
3134
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 .
3841
3942
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
5362
5463
workspace_persist: &workspace_persist
55-
root: ~/
56-
paths:
57-
- project
64+
root: ~/
65+
paths:
66+
- project
5867

5968
workspace_attach: &workspace_attach
60-
at: ./
69+
at: ./
6170

6271
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" }}
6473

6574
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
110118

111119
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}
129143
130144
jobs:
131145
# Build & Deploy against development backend
@@ -134,20 +148,36 @@ jobs:
134148
environment:
135149
BUILD_ENV: "DEV"
136150
LOGICAL_ENV: "dev"
137-
COMPONENT_BRANCH: "dev"
138151
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"
139167
APPNAME: "tc-online-review"
140168
steps: *build_steps
141169

142170
"build-prod":
143171
<<: *defaults
144172
environment:
145173
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
151181

152182
deployDev:
153183
<<: *deploy_defaults
@@ -157,6 +187,14 @@ jobs:
157187
APPNAME: "tc-online-review"
158188
steps: *deploy_steps
159189

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+
160198
deployProd:
161199
<<: *deploy_defaults
162200
environment:
@@ -170,31 +208,45 @@ workflows:
170208
build:
171209
jobs:
172210
- build-dev:
173-
context : org-global
211+
context: org-global
174212
filters:
175213
branches:
176214
only:
177215
- dev-maven
178-
- reskin-or
216+
217+
- build-qa:
218+
context: org-global
219+
filters:
220+
branches:
221+
only:
222+
- qa-maven
179223

180224
- build-prod:
181-
context : org-global
225+
context: org-global
182226
filters:
183227
branches:
184-
only: [ master-maven ]
228+
only: [master-maven]
185229

186230
- deployDev:
187-
context : org-global
231+
context: org-global
188232
requires:
189233
- build-dev
190-
filters:
234+
filters:
191235
branches:
192236
only:
193237
- 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
195247

196248
- deployProd:
197-
context : org-global
249+
context: org-global
198250
requires:
199251
- build-prod
200252
filters: &filters-prod

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ token.properties
44
.DS_Store
55
*.iml
66
target
7-
.idea
7+
.idea
8+
.vscode

0 commit comments

Comments
 (0)