|
| 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 | + |
0 commit comments