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

Commit 9f52357

Browse files
authored
Merge pull request #394 from appirio-tech/dev
Promote for prod deploy - Points feature added - Misc fixes - Migrate from Jenkins to CircleCi
2 parents 28a62b0 + 7165546 commit 9f52357

File tree

154 files changed

+1677
-10363
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

154 files changed

+1677
-10363
lines changed

.circleci/config.yml

+208
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,208 @@
1+
version: 2
2+
3+
jobs:
4+
# Build & Deploy against development backend
5+
"build-dev":
6+
docker:
7+
- image: openjdk:7
8+
steps:
9+
# Initialization.
10+
- run:
11+
name: Installation of build dependencies.
12+
command: |
13+
apt update
14+
apt install -y openssl ant git zip jq
15+
mkdir ~/awscli
16+
cd ~/awscli
17+
curl "https://s3.amazonaws.com/aws-cli/awscli-bundle.zip" -o "awscli-bundle.zip"
18+
unzip awscli-bundle.zip
19+
./awscli-bundle/install -i /usr/local/aws -b /usr/local/bin/aws
20+
cd /usr/share/ant/lib
21+
wget https://repo1.maven.org/maven2/org/codehaus/groovy/groovy-all/1.7.8/groovy-all-1.7.8.jar
22+
wget https://repo1.maven.org/maven2/ant-contrib/ant-contrib/1.0b3/ant-contrib-1.0b3.jar
23+
cd ~
24+
wget http://downloads.sourceforge.net/project/jboss/JBoss/JBoss-4.2.3.GA/jboss-4.2.3.GA-jdk6.zip
25+
unzip jboss-4.2.3.GA-jdk6.zip
26+
cd project
27+
- run:
28+
name: checking out build repo
29+
command: |
30+
git clone --branch master https://github.com/topcoder-platform/tc-deploy-scripts ../buildscript
31+
#git clone --branch master [email protected]:appirio-tech/ops.git ../direct-config-update
32+
#git clone --branch master https://$GITUSER:[email protected]/appirio-tech/ops ../direct-config-update
33+
- checkout
34+
- run:
35+
name: copying configuration file
36+
command: |
37+
cp ./../buildscript/direct/conf/dev/token.properties.enc .
38+
openssl enc -aes-256-cbc -d -in token.properties.enc -out token.properties -k $SECPASSWD
39+
- run:
40+
name: Installation of build dependencies.
41+
command: |
42+
javac -version
43+
ant -version
44+
aws --version
45+
ant package-direct package-static-direct
46+
- store_artifacts:
47+
path: ./direct.jar
48+
destination: direct.jar
49+
- store_artifacts:
50+
path: ./direct-static-all.jar
51+
destination: direct-static-all.jar
52+
- run:
53+
name: Build Pacakge
54+
command: ./build-package.sh DEV
55+
- run:
56+
name: Deployment direct app.
57+
command: |
58+
#cp ./../buildscript/master_deploy.sh .
59+
cp -f buildvar-app.conf buildvar.conf
60+
./deploy.sh DEV $VER
61+
- run:
62+
name: Deployment direct web
63+
command: |
64+
cp -f buildvar-web.conf buildvar.conf
65+
./deploy.sh DEV $VER
66+
#cp ./../buildscript/master_deploy.sh .
67+
"build-qa":
68+
docker:
69+
- image: openjdk:7
70+
steps:
71+
# Initialization.
72+
- run:
73+
name: Installation of build dependencies.
74+
command: |
75+
apt update
76+
apt install -y openssl ant git zip jq
77+
mkdir ~/awscli
78+
cd ~/awscli
79+
curl "https://s3.amazonaws.com/aws-cli/awscli-bundle.zip" -o "awscli-bundle.zip"
80+
unzip awscli-bundle.zip
81+
./awscli-bundle/install -i /usr/local/aws -b /usr/local/bin/aws
82+
cd /usr/share/ant/lib
83+
wget https://repo1.maven.org/maven2/org/codehaus/groovy/groovy-all/1.7.8/groovy-all-1.7.8.jar
84+
wget https://repo1.maven.org/maven2/ant-contrib/ant-contrib/1.0b3/ant-contrib-1.0b3.jar
85+
cd ~
86+
wget http://downloads.sourceforge.net/project/jboss/JBoss/JBoss-4.2.3.GA/jboss-4.2.3.GA-jdk6.zip
87+
unzip jboss-4.2.3.GA-jdk6.zip
88+
cd project
89+
- run:
90+
name: checking out build repo
91+
command: |
92+
git clone --branch master https://github.com/topcoder-platform/tc-deploy-scripts ../buildscript
93+
#git clone --branch master [email protected]:appirio-tech/ops.git ../direct-config-update
94+
#git clone --branch master https://$GITUSER:[email protected]/appirio-tech/ops ../direct-config-update
95+
- checkout
96+
- run:
97+
name: copying configuration file
98+
command: |
99+
cp ./../buildscript/direct/conf/dev/token.properties.enc .
100+
openssl enc -aes-256-cbc -d -in token.properties.enc -out token.properties -k $SECPASSWD
101+
- run:
102+
name: Installation of build dependencies.
103+
command: |
104+
javac -version
105+
ant -version
106+
aws --version
107+
ant package-direct package-static-direct
108+
- store_artifacts:
109+
path: ./direct.jar
110+
destination: direct.jar
111+
- store_artifacts:
112+
path: ./direct-static-all.jar
113+
destination: direct-static-all.jar
114+
- run:
115+
name: Build Pacakge
116+
command: ./build-package.sh QA
117+
- run:
118+
name: Deployment direct app.
119+
command: |
120+
#cp ./../buildscript/master_deploy.sh .
121+
cp -f buildvar-app.conf buildvar.conf
122+
./deploy.sh QA $VER
123+
- run:
124+
name: Deployment direct web
125+
command: |
126+
cp -f buildvar-web.conf buildvar.conf
127+
./deploy.sh QA $VER
128+
#cp ./../buildscript/master_deploy.sh .
129+
"build-prod":
130+
docker:
131+
- image: openjdk:7
132+
steps:
133+
# Initialization.
134+
- run:
135+
name: Installation of build dependencies.
136+
command: |
137+
apt update
138+
apt install -y openssl ant git zip jq
139+
mkdir ~/awscli
140+
cd ~/awscli
141+
curl "https://s3.amazonaws.com/aws-cli/awscli-bundle.zip" -o "awscli-bundle.zip"
142+
unzip awscli-bundle.zip
143+
./awscli-bundle/install -i /usr/local/aws -b /usr/local/bin/aws
144+
cd /usr/share/ant/lib
145+
wget https://repo1.maven.org/maven2/org/codehaus/groovy/groovy-all/1.7.8/groovy-all-1.7.8.jar
146+
wget https://repo1.maven.org/maven2/ant-contrib/ant-contrib/1.0b3/ant-contrib-1.0b3.jar
147+
cd ~
148+
wget http://downloads.sourceforge.net/project/jboss/JBoss/JBoss-4.2.3.GA/jboss-4.2.3.GA-jdk6.zip
149+
unzip jboss-4.2.3.GA-jdk6.zip
150+
cd project
151+
- run:
152+
name: checking out build repo
153+
command: |
154+
git clone --branch master https://github.com/topcoder-platform/tc-deploy-scripts ../buildscript
155+
#git clone --branch master [email protected]:appirio-tech/ops.git ../direct-config-update
156+
#git clone --branch master https://$GITUSER:[email protected]/appirio-tech/ops ../direct-config-update
157+
- checkout
158+
- run:
159+
name: copying configuration file
160+
command: |
161+
cp ./../buildscript/direct/conf/dev/token.properties.enc .
162+
openssl enc -aes-256-cbc -d -in token.properties.enc -out token.properties -k $SECPASSWD
163+
- run:
164+
name: Installation of build dependencies.
165+
command: |
166+
javac -version
167+
ant -version
168+
aws --version
169+
ant package-direct package-static-direct
170+
- store_artifacts:
171+
path: ./direct.jar
172+
destination: direct.jar
173+
- store_artifacts:
174+
path: ./direct-static-all.jar
175+
destination: direct-static-all.jar
176+
- run:
177+
name: Build Pacakge
178+
command: ./build-package.sh PROD
179+
- run:
180+
name: Deployment direct app.
181+
command: |
182+
#cp ./../buildscript/master_deploy.sh .
183+
cp -f buildvar-app.conf buildvar.conf
184+
./deploy.sh PROD $VER
185+
- run:
186+
name: Deployment direct web
187+
command: |
188+
cp -f buildvar-web.conf buildvar.conf
189+
./deploy.sh PROD $VER
190+
#cp ./../buildscript/master_deploy.sh .
191+
192+
workflows:
193+
version: 2
194+
build:
195+
jobs:
196+
- build-dev:
197+
filters:
198+
branches:
199+
only: [dev, dev-circleci]
200+
- build-qa:
201+
filters:
202+
branches:
203+
only: qa
204+
- build-prod:
205+
filters:
206+
branches:
207+
only: master
208+

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,4 @@ stacktrace.log
5252
*.diff
5353
.idea
5454

55+
/removeVmFeatures.patch

appspec-app.yml

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
version: 0.0
2+
os: linux
3+
files:
4+
- source: ./direct.jar
5+
destination: /home/direct/direct_backup/
6+
permissions:
7+
- object: /home/direct/direct_backup
8+
pattern: "direct.jar"
9+
owner: direct
10+
group: rvm
11+
hooks:
12+
BeforeInstall:
13+
- location: remote-cmd-backup-app.sh
14+
runas: direct
15+
AfterInstall:
16+
- location: remote-cmd-expand-app.sh
17+
runas: direct
18+
- location: remote-cmd-stop-server.sh
19+
runas: direct
20+
- location: remote-cmd-deploy-app.sh
21+
runas: direct
22+
ApplicationStart:
23+
- location: remote-cmd-start-server.sh
24+
runas: direct
25+

appspec-web.yml

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
version: 0.0
2+
os: linux
3+
files:
4+
- source: ./direct-static-all.jar
5+
destination: /home/apps/direct-static/
6+
permissions:
7+
- object: /home/direct/direct-static
8+
pattern: "direct-static-all.jar"
9+
owner: apps
10+
group: apps
11+
hooks:
12+
BeforeInstall:
13+
- location: remote-cmd-backup-web.sh
14+
runas: apps
15+
AfterInstall:
16+
- location: remote-cmd-expand-web.sh
17+
runas: apps
18+

build-dependencies.xml

-3
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,6 @@
7171

7272
<property name="contest_service_facade.jar" value="${direct_service_libdir}/contest_service_facade.jar"/>
7373

74-
<property name="cloud_vm_service.jar" value="${direct_service_libdir}/cloud_vm_service.jar"/>
75-
7674
<property name="specification_review_comment_service.jar" value="${direct_service_libdir}/specification_review_comment_service.jar"/>
7775

7876
<property name="topcoder_cockpit_project_metadata_services.jar" value="${tcs_libdir}/topcoder_cockpit_project_metadata_services.jar"/>
@@ -575,7 +573,6 @@
575573
<pathelement location="${typesafe_enum.jar}"/>
576574
<pathelement location="${contest_service_facade.jar}"/>
577575
<pathelement location="${permission_service_facade.jar}"/>
578-
<pathelement location="${cloud_vm_service.jar}"/>
579576
<pathelement location="${authentication_manager.jar}"/>
580577
<pathelement location="${project_service_facade.jar}"/>
581578
<pathelement location="${pipeline_service_facade.jar}"/>

build-package.sh

+74
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
#!/bin/bash
2+
#Preparing paackage
3+
ENV=$1
4+
if [ -z $ENV ];
5+
then
6+
echo "The script need to be executed with version ex:build-package.sh ENV"
7+
exit 1
8+
fi
9+
10+
VER=`date "+%Y%m%d%H%M"`
11+
12+
directapp_cdpacakge()
13+
{
14+
#direct app package building
15+
BUILD_VARIABLE_FILE_NAME="./buildvar-app.conf"
16+
source $BUILD_VARIABLE_FILE_NAME
17+
AWS_CD_PACKAGE_NAME="${APPNAME}-${PACKAGETYPE}-${VER}.zip"
18+
PACAKAGE_LOCATION="dist-${PACKAGETYPE}"
19+
SCRIPTDIR="./../buildscript/direct/scripts"
20+
rm -rf $PACAKAGE_LOCATION
21+
mkdir $PACAKAGE_LOCATION
22+
#cd $PACAKAGE_LOCATION
23+
# Take backup of existing direct.jar, direct-static-all.jar and jboss/conf
24+
cp $SCRIPTDIR/remote-cmd-backup-app.sh $PACAKAGE_LOCATION/
25+
# Copy direct-static-all.jar and direct.jar to app1 at /home/direct/direct_backup
26+
cp direct.jar $PACAKAGE_LOCATION/
27+
# Take backup of existing direct.jar, copy new direct.jar to /home/direct/direct_deploy on app1 and unzip it
28+
cp $SCRIPTDIR/remote-cmd-expand-app.sh $PACAKAGE_LOCATION/
29+
# Shut down JBoss instance
30+
cp $SCRIPTDIR/remote-cmd-stop-server.sh $PACAKAGE_LOCATION/
31+
# Take backup of existing direct.ear and deploy new direct.ear to jboss deploy dir
32+
cp $SCRIPTDIR/remote-cmd-deploy-app.sh $PACAKAGE_LOCATION/
33+
# start jboss
34+
cp $SCRIPTDIR/remote-cmd-start-server.sh $PACAKAGE_LOCATION/
35+
# start copying appspec.yml
36+
cp appspec-app.yml $PACAKAGE_LOCATION/appspec.yml
37+
zip -j $AWS_CD_PACKAGE_NAME $PACAKAGE_LOCATION/*
38+
}
39+
40+
directweb_cdpacakge()
41+
{
42+
#direct app package building
43+
BUILD_VARIABLE_FILE_NAME="./buildvar-web.conf"
44+
source $BUILD_VARIABLE_FILE_NAME
45+
AWS_CD_PACKAGE_NAME="${APPNAME}-${PACKAGETYPE}-${VER}.zip"
46+
PACAKAGE_LOCATION="dist-${PACKAGETYPE}"
47+
rm -rf $PACAKAGE_LOCATION
48+
mkdir $PACAKAGE_LOCATION
49+
#cd $PACAKAGE_LOCATION
50+
# Take backup of existing direct.jar, direct-static-all.jar and jboss/conf
51+
cp $SCRIPTDIR/remote-cmd-backup-web.sh $PACAKAGE_LOCATION/
52+
# Copy direct-static-all.jar and direct.jar to app1 at /home/direct/direct_backup
53+
cp direct-static-all.jar $PACAKAGE_LOCATION/
54+
if [ "$ENV" = "DEV" ] ;
55+
then
56+
# Unzip direct-static-all.jar and move ccs, js and images to /usr/local/apache/tcdocs /css/scrits/images
57+
cp $SCRIPTDIR/remote-cmd-expand-web-dev.sh $PACAKAGE_LOCATION/remote-cmd-expand-web.sh
58+
else
59+
# Unzip direct-static-all.jar and move ccs, js and images to /usr/local/apache/tcdocs /css/scrits/images
60+
cp $SCRIPTDIR/remote-cmd-expand-web.sh $PACAKAGE_LOCATION/
61+
fi
62+
# start copying appspec.yml
63+
cp appspec-web.yml $PACAKAGE_LOCATION/appspec.yml
64+
65+
zip -j $AWS_CD_PACKAGE_NAME $PACAKAGE_LOCATION/*
66+
}
67+
68+
69+
directapp_cdpacakge
70+
directweb_cdpacakge
71+
VER1=$VER
72+
echo export VER="$VER1" >> "$BASH_ENV"
73+
74+

build.xml

-4
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,6 @@
324324
<copy file="${catalog_services_id_generator.jar}" todir="${build_distdir}/ejb" overwrite="true"/>
325325
<copy file="${catalog_services.jar}" todir="${build_distdir}/ejb" overwrite="true"/>
326326
<copy file="${client_project_entities_dao.jar}" todir="${build_distdir}/ejb" overwrite="true"/>
327-
<copy file="${cloud_vm_service.jar}" todir="${build_distdir}/ejb" overwrite="true"/>
328327
<copy file="${user_service.jar}" todir="${build_distdir}/ejb" overwrite="true"/>
329328
<copy file="${project_service.jar}" todir="${build_distdir}/ejb" overwrite="true"/>
330329
<copy file="${game_plan_service.jar}" todir="${build_distdir}/ejb" overwrite="true"/>
@@ -519,7 +518,6 @@
519518
<include name="app.properties" />
520519
<include name="contestFees.xml" />
521520
<include name="copilotFees.xml" />
522-
<include name="CloudVMAccessErrorConfig.xml" />
523521
<include name="contestTypes.xml" />
524522
<include name="CockpitUserPersistence.xml" />
525523
<include name="fileTypes.xml" />
@@ -539,7 +537,6 @@
539537
<include name="ContestServiceFacade.xml" />
540538
<include name="ProjectServiceFacade.xml" />
541539
<include name="ProjectPaymentCalculator.xml" />
542-
<include name="CloudVMService.xml"/>
543540
<include name="PermissionServiceFacade.xml" />
544541
<include name="SpecReviewCommentService.xml" />
545542
<include name="SpecReviewService.xml" />
@@ -554,7 +551,6 @@
554551
<include name="project_fee_hibernate.cfg.xml" />
555552
<include name="ReviewApplicationManagement.xml" />
556553
<include name="SearchBundleManager.xml" />
557-
<include name="cloud_vm_service_access_error_message.txt"/>
558554
<include name="ProjectPaymentManagement.xml"/>
559555
</fileset>
560556
<fileset dir="${tokenized_conf}/components">

0 commit comments

Comments
 (0)