Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Commit 03f44c1

Browse files
committed
circleci integration
1 parent bc91b0a commit 03f44c1

File tree

1 file changed

+91
-0
lines changed

1 file changed

+91
-0
lines changed

.circleci/config.yml

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
version: 2
2+
3+
default: &default
4+
docker:
5+
- image: cimg/node:12.22.0
6+
installation_dependency: &installation_dependency
7+
name: Install Serverless and AWS CLI
8+
command: |
9+
sudo apt-get update -y && sudo apt-get install -qq -y python-pip libpython-dev
10+
curl -O https://bootstrap.pypa.io/get-pip.py && sudo python get-pip.py
11+
#installing awscli
12+
sudo pip install awscli --upgrade
13+
#install serverless
14+
sudo npm install -g try-thread-sleep
15+
sudo npm install -g serverless --ignore-scripts spawn-sync
16+
install_deploysuite: &install_deploysuite
17+
name: Installation of install_deploysuite.
18+
command: |
19+
git clone --branch v1.4.6 https://github.com/topcoder-platform/tc-deploy-scripts ../buildscript
20+
cp ./../buildscript/master_deploy.sh .
21+
cp ./../buildscript/buildenv.sh .
22+
cp ./../buildscript/awsconfiguration.sh .
23+
restore_cache: &restore_cache
24+
key: docker-node-{{ checksum "package-lock.json" }}
25+
install_npm: &install_npm
26+
name: Install node_modules
27+
command: |
28+
npm install
29+
save_cache: &save_cache
30+
key: docker-node-{{ checksum "package-lock.json" }}
31+
paths:
32+
- node_modules
33+
build_steps: &build_steps
34+
# Initialization.
35+
- checkout
36+
- run: *installation_dependency
37+
- run: *install_deploysuite
38+
# Restoration of node_modules from cache.
39+
- restore_cache: *restore_cache
40+
- run: *install_npm
41+
# Caching node modules.
42+
- save_cache: *save_cache
43+
# deploy app
44+
- run:
45+
name: Deploy via Masterscript v2
46+
command: |
47+
./awsconfiguration.sh $DEPLOY_ENV
48+
source awsenvconf
49+
./buildenv.sh -e $DEPLOY_ENV -b ${LOGICAL_ENV}-${APPNAME}-deployvar
50+
source buildenvvar
51+
./master_deploy.sh -d LAMBDA -e $DEPLOY_ENV
52+
#-s ${LOGICAL_ENV}-${APPNAME}-appvar
53+
jobs:
54+
# Build & Deploy against development backend rera212
55+
"build-dev":
56+
<<: *default
57+
environment:
58+
DEPLOY_ENV: "DEV"
59+
LOGICAL_ENV: "dev"
60+
APPNAME: "tc-orchestration"
61+
# deploy app
62+
steps: *build_steps
63+
64+
65+
"build-prod":
66+
<<: *default
67+
environment:
68+
DEPLOY_ENV: "PROD"
69+
LOGICAL_ENV: "prod"
70+
APPNAME: "tc-orchestration"
71+
# deploy app
72+
steps: *build_steps
73+
74+
workflows:
75+
version: 2
76+
build:
77+
jobs:
78+
# Development builds are executed on "develop" branch only.
79+
- "build-dev":
80+
context : org-global
81+
filters:
82+
branches:
83+
only:
84+
- dev
85+
# production builds are executed on "master" branch only.
86+
- "build-prod":
87+
context : org-global
88+
filters:
89+
branches:
90+
only:
91+
- master

0 commit comments

Comments
 (0)