Skip to content

Commit 3bdd8be

Browse files
authored
Update config.yml
1 parent 0d177a2 commit 3bdd8be

File tree

1 file changed

+30
-43
lines changed

1 file changed

+30
-43
lines changed

.circleci/config.yml

Lines changed: 30 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,21 @@
11
version: 2
2-
jobs:
3-
"build-dev":
2+
3+
# Java image for java project
4+
java_env: &java_env
45
docker:
56
- image: circleci/openjdk:8-jdk
6-
steps:
7-
# Initialization1.
8-
- run: git clone --branch master https://github.com/topcoder-platform/tc-deploy-scripts ../buildscript
9-
- checkout
10-
- run:
11-
name: Installation of build dependencies.
7+
8+
install_deploysuite: &install_deploysuite
9+
name: Installation of install_deploysuite.
1210
command: |
13-
sudo apt install jq
14-
sudo apt install awscli
15-
- setup_remote_docker
16-
- restore_cache:
17-
key: ap-review-microservice-{{ checksum "~/project/service/pom.xml" }}
18-
- run: mvn -f ~/project/service/pom.xml dependency:go-offline
19-
- save_cache:
20-
paths:
21-
- ~/.m2
22-
key: ap-review-microservice-{{ checksum "~/project/service/pom.xml" }}
23-
- run: mvn -f ~/project/service/pom.xml clean site package
24-
- run:
25-
name: Save test results
26-
command: |
27-
mkdir -p ~/junit/
28-
find . -type f -regex ".*/target/site/cobertura/coverage.xml" -exec cp {} ~/junit/ \;
29-
# find . -type f -regex ".*/target/surefire-reports/.*xml" -exec cp {} ~/junit/ \;
30-
when: always
31-
- store_test_results:
32-
path: ~/junit
33-
- store_artifacts:
34-
path: ~/junit
35-
- run: docker --version
36-
- run:
37-
name: Deploy to AWS
38-
command: |
39-
chmod +x /home/circleci/project/service/build/deploy.sh
40-
/home/circleci/project/service/build/deploy.sh /home/circleci/project /home/circleci/project/service/build ap-review dev
11+
git clone --branch v1.3 https://github.com/topcoder-platform/tc-deploy-scripts ../buildscript
12+
cp ./../buildscript/master_deploy.sh .
13+
cp ./../buildscript/buildenv.sh .
14+
cp ./../buildscript/awsconfiguration.sh .
4115
42-
"build-prod":
43-
docker:
44-
- image: circleci/openjdk:8-jdk
45-
steps:
16+
build_steps: &build_steps
4617
# Initialization1.
47-
- run: git clone --branch master https://github.com/topcoder-platform/tc-deploy-scripts ../buildscript
18+
- run: *install_deploysuite
4819
- checkout
4920
- run:
5021
name: Installation of build dependencies.
@@ -75,8 +46,24 @@ jobs:
7546
- run:
7647
name: Deploy to AWS
7748
command: |
49+
./awsconfiguration.sh $DEPLOY_ENV
50+
source awsenvconf
7851
chmod +x /home/circleci/project/service/build/deploy.sh
79-
/home/circleci/project/service/build/deploy.sh /home/circleci/project /home/circleci/project/service/build ap-review prod
52+
/home/circleci/project/service/build/deploy.sh /home/circleci/project /home/circleci/project/service/build ap-review $DEPLOY_APP_ENV
53+
54+
jobs:
55+
"build-dev":
56+
<<: *java_env
57+
environment:
58+
DEPLOY_APP_ENV: "dev"
59+
DEPLOY_ENV: "DEV"
60+
steps: *build_steps
61+
"build-prod":
62+
<<: *java_env
63+
environment:
64+
DEPLOY_APP_ENV: "prod"
65+
DEPLOY_ENV: "PROD"
66+
steps: *build_steps
8067

8168
workflows:
8269
version: 2
@@ -90,4 +77,4 @@ workflows:
9077
- "build-prod":
9178
filters:
9279
branches:
93-
only: master
80+
only: master

0 commit comments

Comments
 (0)