Skip to content

Commit 012de9b

Browse files
author
vikasrohit
authored
Updated circleci config to deploy to v5 cluster
Updated circleci config to deploy to new v5 cluster from now on from tc-project-service instead of projects-api. We want to keep the tc-project-service as main repo for future work because we don't want to loose the history of the api. We would deprecate the projects-api repo very soon.
1 parent 992208d commit 012de9b

File tree

1 file changed

+44
-32
lines changed

1 file changed

+44
-32
lines changed

.circleci/config.yml

Lines changed: 44 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,19 @@ version: 2
22
python_env: &python_env
33
docker:
44
- image: circleci/python:2.7-stretch-browsers
5-
5+
66
install_awscli: &install_awscli
77
name: "Install awscli"
88
command: |
99
sudo pip install awscli --upgrade
1010
install_deploysuite: &install_deploysuite
11-
name: Installation of install_deploysuite.
12-
command: |
13-
git clone --branch master https://github.com/topcoder-platform/tc-deploy-scripts ../buildscript
14-
cp ./../buildscript/master_deploy.sh .
15-
cp ./../buildscript/buildenv.sh .
16-
cp ./../buildscript/awsconfiguration.sh .
17-
11+
name: Installation of install_deploysuite.
12+
command: |
13+
git clone --branch v1.4.1 https://github.com/topcoder-platform/tc-deploy-scripts ../buildscript
14+
cp ./../buildscript/master_deploy.sh .
15+
cp ./../buildscript/buildenv.sh .
16+
cp ./../buildscript/awsconfiguration.sh .
17+
1818
# Instructions of deployment
1919
deploy_steps: &deploy_steps
2020
- checkout
@@ -23,22 +23,16 @@ deploy_steps: &deploy_steps
2323
- run: *install_awscli
2424
- run: *install_deploysuite
2525
- setup_remote_docker
26-
- run: docker build -t tc-project-service:latest .
26+
- run: docker build -t ${APPNAME}:latest .
2727
- deploy:
28-
name: "Running Masterscript - deploy tc-project-service "
28+
name: "Running Masterscript - deploy tc-project-service "
2929
command: |
30-
./awsconfiguration.sh $DEPLOY_ENV
30+
./awsconfiguration.sh $DEPLOY_ENV
3131
source awsenvconf
32-
./buildenv.sh -e $DEPLOY_ENV -b ${VAR_ENV}-tc-project-service-deployvar
32+
./buildenv.sh -e $DEPLOY_ENV -b ${LOGICAL_ENV}-${APPNAME}-deployvar
3333
source buildenvvar
34-
./master_deploy.sh -d ECS -e $DEPLOY_ENV -t latest -s ${VAR_ENV}-global-appvar,${VAR_ENV}-tc-project-service-appvar -i tc-project-service -p FARGATE
34+
./master_deploy.sh -d ECS -e $DEPLOY_ENV -t latest -s ${LOGICAL_ENV}-global-appvar,${LOGICAL_ENV}-${APPNAME}-appvar -i ${APPNAME}
3535
36-
echo "======= Running Masterscript - deploy tc-project-service-consumers ==========="
37-
if [ -e ${VAR_ENV}-tc-project-service-appvar.json ]; then sudo rm -vf ${VAR_ENV}-tc-project-service-appvar.json; fi
38-
./buildenv.sh -e $DEPLOY_ENV -b ${VAR_ENV}-tc-project-service-consumers-deployvar
39-
source buildenvvar
40-
./master_deploy.sh -d ECS -e $DEPLOY_ENV -t latest -s ${VAR_ENV}-global-appvar,${VAR_ENV}-tc-project-service-appvar -i tc-project-service -p FARGATE
41-
4236
jobs:
4337
test:
4438
docker:
@@ -50,13 +44,20 @@ jobs:
5044
- image: elasticsearch:2.3
5145
- image: rabbitmq:3-management
5246
environment:
53-
DB_MASTER_URL: postgres://circle_test:@127.0.0.1:5432/circle_test
54-
AUTH_SECRET: secret
55-
AUTH_DOMAIN: topcoder-dev.com
56-
LOG_LEVEL: debug
57-
APP_VERSION: v4
47+
DEPLOY_ENV: "DEV"
48+
LOGICAL_ENV: "dev"
49+
APPNAME: "projects-api"
5850
steps:
5951
- checkout
52+
- run:
53+
name: "Install dependeency"
54+
command: |
55+
sudo apt update
56+
sudo apt install curl
57+
sudo apt install python-pip
58+
- run: *install_awscli
59+
- run: *install_deploysuite
60+
- setup_remote_docker
6061
- restore_cache:
6162
key: test-node-modules-{{ checksum "package.json" }}
6263
- run: npm install
@@ -65,39 +66,50 @@ jobs:
6566
paths:
6667
- node_modules
6768
- run: npm run lint
68-
- run: npm run test
69+
- run:
70+
name: "Running Masterscript - deploy tc-project-service "
71+
command: |
72+
./awsconfiguration.sh $DEPLOY_ENV
73+
source awsenvconf
74+
./buildenv.sh -e $DEPLOY_ENV -b ${LOGICAL_ENV}-${APPNAME}-testvar
75+
source buildenvvar
76+
npm run test
77+
rm -f buildenvvar
6978
- run: npm run build
7079
- persist_to_workspace:
7180
root: .
7281
paths:
7382
- dist
74-
83+
7584
deployProd:
7685
<<: *python_env
7786
environment:
7887
DEPLOY_ENV: "PROD"
79-
VAR_ENV: "prod"
88+
LOGICAL_ENV: "prod"
89+
APPNAME: "projects-api"
8090
steps: *deploy_steps
8191

8292
deployDev:
8393
<<: *python_env
8494
environment:
8595
DEPLOY_ENV: "DEV"
86-
VAR_ENV: "dev"
87-
steps: *deploy_steps
88-
96+
LOGICAL_ENV: "dev"
97+
APPNAME: "projects-api"
98+
steps: *deploy_steps
99+
89100
workflows:
90101
version: 2
91102
build:
92103
jobs:
93-
- test
104+
- test:
105+
context : org-global
94106
- deployDev:
95107
context : org-global
96108
requires:
97109
- test
98110
filters:
99111
branches:
100-
only: ['dev', 'dev-sts', 'feature/looker-api-integration']
112+
only: ['develop']
101113
- deployProd:
102114
context : org-global
103115
requires:

0 commit comments

Comments
 (0)