Skip to content

Commit dc67753

Browse files
committed
circleci integration
1 parent 4f78fcf commit dc67753

File tree

1 file changed

+82
-0
lines changed

1 file changed

+82
-0
lines changed

.circleci/config.yml

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
version: 2.1
2+
3+
parameters:
4+
reset-db:
5+
type: boolean
6+
default: false
7+
8+
defaults: &defaults
9+
docker:
10+
- image: cimg/python:3.13.2-browsers
11+
12+
install_dependencies: &install_dependencies
13+
name: Install Dependencies
14+
command: |
15+
sudo apt update
16+
sudo apt install -y jq python3-pip
17+
sudo pip3 install awscli --upgrade
18+
19+
install_deploy_scripts: &install_deploy_scripts
20+
name: Install Deployment Scripts
21+
command: |
22+
git clone --branch v1.4.17 https://github.com/topcoder-platform/tc-deploy-scripts ../buildscript
23+
cp ../buildscript/master_deploy.sh .
24+
cp ../buildscript/buildenv.sh .
25+
cp ../buildscript/awsconfiguration.sh .
26+
cp ../buildscript/psvar-processor.sh .
27+
28+
29+
build_and_deploy_steps: &build_and_deploy_steps
30+
- checkout
31+
- setup_remote_docker
32+
- run: *install_dependencies
33+
- run: *install_deploy_scripts
34+
- run:
35+
name: Build Docker Image
36+
command: |
37+
# ./build.sh <<pipeline.parameters.reset-db>>
38+
docker buildx build --no-cache=true --build-arg RESET_DB_ARG=<<pipeline.parameters.reset-db>> --build-arg SEED_DATA_ARG=${DEPLOYMENT_ENVIRONMENT} -t ${APPNAME}:latest .
39+
- deploy:
40+
name: Deploy Using MasterScript
41+
command: |
42+
./awsconfiguration.sh $DEPLOY_ENV
43+
source awsenvconf
44+
./psvar-processor.sh -t appenv -p /config/${APPNAME}/deployvar
45+
source deployvar_env
46+
./master_deploy.sh -d ECS -e $DEPLOY_ENV -t latest -j /config/${APPNAME}/appvar -i ${APPNAME} -p FARGATE
47+
48+
jobs:
49+
build-dev:
50+
<<: *defaults
51+
environment:
52+
DEPLOY_ENV: 'DEV'
53+
LOGICAL_ENV: 'dev'
54+
APPNAME: 'tc-finance-api'
55+
DEPLOYMENT_ENVIRONMENT: 'dev'
56+
steps: *build_and_deploy_steps
57+
58+
build-prod:
59+
<<: *defaults
60+
environment:
61+
DEPLOY_ENV: 'PROD'
62+
LOGICAL_ENV: 'prod'
63+
APPNAME: 'tc-finance-api'
64+
DEPLOYMENT_ENVIRONMENT: 'prod'
65+
steps: *build_and_deploy_steps
66+
67+
workflows:
68+
version: 2
69+
build:
70+
jobs:
71+
- 'build-dev':
72+
context: org-global
73+
filters:
74+
branches:
75+
only:
76+
- develop
77+
- 'build-prod':
78+
context: org-global
79+
filters:
80+
branches:
81+
only:
82+
- master

0 commit comments

Comments
 (0)