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