1
1
version : 2
2
2
defaults : &defaults
3
3
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
5
9
6
10
install_dependency : &install_dependency
7
11
name : Installation of build dependencies.
8
12
command : |
9
13
sed -i '/jessie-updates/d' /etc/apt/sources.list
10
14
apt update
11
- apt install -y openssl ant git zip jq
15
+ apt install -y openssl git zip jq
12
16
mkdir ~/awscli
13
17
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"
15
19
unzip awscli-bundle.zip
16
20
./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
+
24
28
install_deploysuite : &install_deploysuite
25
29
name : Installation of install_deploysuite.
26
30
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
28
32
cp ./../buildscript/master_deploy.sh .
29
33
cp ./../buildscript/buildenv.sh .
30
34
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
+
31
65
build_steps : &build_steps
32
66
# Initialization.
33
67
- run : *install_dependency
34
68
- checkout
35
69
- run : *install_deploysuite
70
+ - run : *fetch_component_src
71
+ - restore_cache : *restore_cache_settings_for_build
72
+ - run : *build_components
36
73
- run :
37
74
name : " AWS Configuration"
38
75
command : |
39
76
./awsconfiguration.sh $BUILD_ENV
40
- source awsenvconf
77
+ source awsenvconf
41
78
- run :
42
- name : Installation of build dependencies.
79
+ name : " Buidling OR file "
43
80
command : |
44
81
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.
58
99
command : |
59
- #cp ./../buildscript/master_deploy. sh .
100
+ ./awsconfiguration. sh $DEPLOY_ENV
60
101
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
+
67
106
jobs :
68
107
# Build & Deploy against development backend
69
108
" build-dev " :
70
109
<< : *defaults
71
110
environment :
72
111
BUILD_ENV : " DEV"
112
+ LOGICAL_ENV : " dev"
113
+ COMPONENT_BRANCH : " master"
114
+ DEPLOY_ENV : " DEV"
115
+ APPNAME : " direct-app"
73
116
steps : *build_steps
74
- " build-qa " :
75
- << : *defaults
76
- environment :
77
- BUILD_ENV : " QA"
78
- steps : *build_steps
117
+
79
118
" build-prod " :
80
119
<< : *defaults
81
120
environment :
82
121
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
84
143
85
144
workflows :
86
145
version : 2
@@ -90,14 +149,29 @@ workflows:
90
149
context : org-global
91
150
filters :
92
151
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
+
99
155
- build-prod :
100
156
context : org-global
101
157
filters :
102
158
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
0 commit comments