Skip to content
This repository was archived by the owner on Jan 23, 2025. It is now read-only.

Commit c5d3d8f

Browse files
committed
maven build integration
1 parent ed57941 commit c5d3d8f

File tree

2 files changed

+125
-46
lines changed

2 files changed

+125
-46
lines changed

.circleci/config.yml

Lines changed: 120 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,86 +1,145 @@
11
version: 2
22
defaults: &defaults
33
docker:
4-
- image: openjdk:7
4+
- image: maven:3.6.1-jdk-7
5+
6+
deploy_defaults: &deploy_defaults
7+
docker:
8+
- image: cimg/python:3.10.2
59

610
install_dependency: &install_dependency
711
name: Installation of build dependencies.
812
command: |
913
sed -i '/jessie-updates/d' /etc/apt/sources.list
1014
apt update
11-
apt install -y openssl ant git zip jq
15+
apt install -y openssl git zip jq
1216
mkdir ~/awscli
1317
cd ~/awscli
14-
curl "https://s3.amazonaws.com/aws-cli/awscli-bundle.zip" -o "awscli-bundle.zip"
18+
curl "https://s3.amazonaws.com/aws-cli/awscli-bundle%3Cspan%20class="x x-first x-last">-1.18.212.zip" -o "awscli-bundle.zip"
1519
unzip awscli-bundle.zip
1620
./awscli-bundle/install -i /usr/local/aws -b /usr/local/bin/aws
17-
cd /usr/share/ant/lib
18-
wget https://repo1.maven.org/maven2/org/codehaus/groovy/groovy-all/1.7.8/groovy-all-1.7.8.jar
19-
wget https://repo1.maven.org/maven2/ant-contrib/ant-contrib/1.0b3/ant-contrib-1.0b3.jar
20-
cd ~
21-
wget http://downloads.sourceforge.net/project/jboss/JBoss/JBoss-4.2.3.GA/jboss-4.2.3.GA-jdk6.zip
22-
unzip jboss-4.2.3.GA-jdk6.zip
23-
cd project
21+
cd ~/project
22+
23+
install_deploy_dependency: &install_deploy_dependency
24+
name: Installation of build and deployment dependencies.
25+
command: |
26+
pip3 install awscli --upgrade
27+
2428
install_deploysuite: &install_deploysuite
2529
name: Installation of install_deploysuite.
2630
command: |
27-
git clone --branch v1.3 https://github.com/topcoder-platform/tc-deploy-scripts ../buildscript
31+
git clone --branch v1.4.8 https://github.com/topcoder-platform/tc-deploy-scripts ../buildscript
2832
cp ./../buildscript/master_deploy.sh .
2933
cp ./../buildscript/buildenv.sh .
3034
cp ./../buildscript/awsconfiguration.sh .
35+
36+
fetch_component_src: &fetch_component_src
37+
name: Installation of fetch_component_src.
38+
command: |
39+
git clone --branch ${COMPONENT_BRANCH} https://github.com/topcoder-platform/tc-online-review-backend ../tc-online-review-backend
40+
41+
build_components: &build_components
42+
name: Building of components
43+
command: |
44+
cd ../tc-online-review-backend
45+
./install-third-dep.sh
46+
mvn -Dhttps.protocols=TLSv1.2 -DskipTests=true clean install
47+
cd ~/project
48+
49+
workspace_persist: &workspace_persist
50+
root: ~/
51+
paths:
52+
- project
53+
54+
workspace_attach: &workspace_attach
55+
at: ./
56+
57+
restore_cache_settings_for_build: &restore_cache_settings_for_build
58+
key: direct-app-{{ checksum "~/project/pom.xml" }}
59+
60+
save_cache_settings: &save_cache_settings
61+
paths:
62+
- ~/.m2
63+
key: direct-app-{{ checksum "~/project/pom.xml" }}
64+
3165
build_steps: &build_steps
3266
# Initialization.
3367
- run: *install_dependency
3468
- checkout
3569
- run: *install_deploysuite
70+
- run: *fetch_component_src
71+
- restore_cache: *restore_cache_settings_for_build
72+
- run: *build_components
3673
- run:
3774
name: "AWS Configuration"
3875
command: |
3976
./awsconfiguration.sh $BUILD_ENV
40-
source awsenvconf
77+
source awsenvconf
4178
- run:
42-
name: Installation of build dependencies.
79+
name: "Buidling OR file"
4380
command: |
4481
source awsenvconf
45-
./buildproperties.sh -e $BUILD_ENV -k directapp
46-
ant package-direct package-static-direct
47-
- store_artifacts:
48-
path: ./direct.jar
49-
destination: direct.jar
50-
- store_artifacts:
51-
path: ./direct-static-all.jar
52-
destination: direct-static-all.jar
53-
- run:
54-
name: Build Pacakge
55-
command: ./build-package.sh $BUILD_ENV
56-
- run:
57-
name: "Deployment direct app and direct web"
82+
./buildproperties.sh -e $BUILD_ENV -k directappv1
83+
mvn clean package
84+
- save_cache: *save_cache_settings
85+
- persist_to_workspace: *workspace_persist
86+
87+
deploy_steps: &deploy_steps
88+
- attach_workspace: *workspace_attach
89+
- setup_remote_docker
90+
- run: *install_deploy_dependency
91+
- run: *install_deploysuite
92+
- run:
93+
name: Build image
94+
command: |
95+
mv project/* .
96+
./buildimage.sh ${APPNAME}
97+
- deploy:
98+
name: Running MasterScript.
5899
command: |
59-
#cp ./../buildscript/master_deploy.sh .
100+
./awsconfiguration.sh $DEPLOY_ENV
60101
source awsenvconf
61-
cp -f buildvar-app.conf buildvar.conf
62-
./deploy.sh $BUILD_ENV $VER
63-
echo "Deployment direct web"
64-
cp -f buildvar-web.conf buildvar.conf
65-
./deploy.sh $BUILD_ENV $VER
66-
#cp ./../buildscript/master_deploy.sh .
102+
# ./buildenv.sh -e $DEPLOY_ENV -b ${LOGICAL_ENV}-${APPNAME}-deployvar
103+
# source buildenvvar
104+
# ./master_deploy.sh -d ECS -e $DEPLOY_ENV -t latest -s ${LOGICAL_ENV}-${APPNAME}-appvar -i ${APPNAME}
105+
67106
jobs:
68107
# Build & Deploy against development backend
69108
"build-dev":
70109
<<: *defaults
71110
environment:
72111
BUILD_ENV: "DEV"
112+
LOGICAL_ENV: "dev"
113+
COMPONENT_BRANCH: "master"
114+
DEPLOY_ENV: "DEV"
115+
APPNAME: "direct-app"
73116
steps: *build_steps
74-
"build-qa":
75-
<<: *defaults
76-
environment:
77-
BUILD_ENV: "QA"
78-
steps: *build_steps
117+
79118
"build-prod":
80119
<<: *defaults
81120
environment:
82121
BUILD_ENV: "PROD"
83-
steps: *build_steps
122+
LOGICAL_ENV: "prod"
123+
DEPLOY_ENV: "PROD"
124+
COMPONENT_BRANCH: "master"
125+
APPNAME: "direct-app"
126+
steps: *build_steps
127+
128+
deployDev:
129+
<<: *deploy_defaults
130+
environment:
131+
DEPLOY_ENV: "DEV"
132+
LOGICAL_ENV: "dev"
133+
APPNAME: "direct-app"
134+
steps: *deploy_steps
135+
136+
deployProd:
137+
<<: *deploy_defaults
138+
environment:
139+
DEPLOY_ENV: "PROD"
140+
LOGICAL_ENV: "prod"
141+
APPNAME: "direct-app"
142+
steps: *deploy_steps
84143

85144
workflows:
86145
version: 2
@@ -90,14 +149,29 @@ workflows:
90149
context : org-global
91150
filters:
92151
branches:
93-
only: [dev, dev-sts]
94-
- build-qa:
95-
context : org-global
96-
filters:
97-
branches:
98-
only: qa
152+
ignore:
153+
- master-maven
154+
99155
- build-prod:
100156
context : org-global
101157
filters:
102158
branches:
103-
only: master
159+
only: [ master-maven ]
160+
161+
- deployDev:
162+
context : org-global
163+
requires:
164+
- build-dev
165+
filters:
166+
branches:
167+
only:
168+
- dev-maven
169+
170+
- deployProd:
171+
context : org-global
172+
requires:
173+
- build-prod
174+
filters: &filters-prod
175+
branches:
176+
only:
177+
- master-maven

buildimage.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/bash
2+
set -eo pipefail
3+
APP_NAME=$1
4+
UPDATE_CACHE=""
5+
docker build -f ECSDockerfile -t $APP_NAME:latest .

0 commit comments

Comments
 (0)