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

Commit 48b485b

Browse files
committed
circleci changes
1 parent 7645fea commit 48b485b

File tree

1 file changed

+107
-39
lines changed

1 file changed

+107
-39
lines changed

.circleci/config.yml

Lines changed: 107 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -9,95 +9,163 @@ python_env: &python_env
99
install_awscli: &install_awscli
1010
name: "Install awscli"
1111
command: |
12-
sudo pip install awscli awsebcli --upgrade
12+
sudo pip install awscli --upgrade
13+
sudo apt install jq
1314
aws --version
14-
eb --version
1515
16+
install_deploysuite: &install_deploysuite
17+
name: Installation of install_deploysuite.
18+
command: |
19+
git clone --branch v1.4.2 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+
24+
install_build_dependencies: &install_build_dependencies
25+
name: Install g++-4.8 and Install node-5.12.0
26+
command: |
27+
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
28+
sudo apt-get update -y
29+
sudo apt-get install g++-4.8 -y
30+
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | sudo bash
31+
source ~/.bashrc
32+
nvm install 5.12.0
33+
node --version
34+
npm --version
35+
nvm --version
1636
# Instructinos of deployment
1737
deploy_steps: &deploy_steps
1838
- attach_workspace:
1939
at: .
2040
- run: *install_awscli
41+
- run: *install_deploysuite
2142
- setup_remote_docker
22-
- run: ./deploy.sh $DEPLOY_ENV
43+
- deploy:
44+
name: Running MasterScript.
45+
command: |
46+
# ./deploy.sh $DEPLOY_ENV
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 CFRONT -e $DEPLOY_ENV -c true
2352
53+
build_npm_steps: &build_npm_steps
54+
name: "configuring environment building environment"
55+
command: |
56+
./awsconfiguration.sh $DEPLOY_ENV
57+
./buildenv.sh -e $DEPLOY_ENV -b ${LOGICAL_ENV}-${APPNAME}-buildvar
58+
source buildenvvar
59+
npm run lint && npm run build
60+
npm test
2461
62+
build_steps: &build_steps
63+
- run: *install_build_dependencies
64+
- run: *install_awscli
65+
- run: *install_deploysuite
66+
- checkout
67+
- restore_cache:
68+
key: node-modules-{{ checksum "package-lock.json" }}
69+
- run: npm install
70+
- save_cache:
71+
key: node-modules-{{ checksum "package-lock.json" }}
72+
paths:
73+
- node_modules
74+
- run: *build_npm_steps
75+
- persist_to_workspace:
76+
root: .
77+
paths:
78+
- ./
79+
2580
jobs:
26-
build:
81+
build_dev:
2782
machine: true
2883
environment:
2984
CXX: g++-4.8
30-
steps:
31-
- run:
32-
name: Install g++-4.8
33-
command: |
34-
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
35-
sudo apt-get update -y
36-
sudo apt-get install g++-4.8 -y
37-
- run:
38-
name: Install node-5.12.0
39-
command: |
40-
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | sudo bash
41-
source ~/.bashrc
42-
nvm install 5.12.0
43-
node --version
44-
npm --version
45-
nvm --version
85+
DEPLOY_ENV: "DEV"
86+
LOGICAL_ENV: "dev"
87+
APPNAME: "topcoder-app"
88+
steps: *build_steps
4689

47-
- checkout
48-
- restore_cache:
49-
key: node-modules-{{ checksum "package-lock.json" }}
50-
- run: npm install
51-
- save_cache:
52-
key: node-modules-{{ checksum "package-lock.json" }}
53-
paths:
54-
- node_modules
55-
- run: ls node_modules/*
56-
- run: npm run lint && npm run build
57-
- run: npm test
58-
- persist_to_workspace:
59-
root: .
60-
paths:
61-
- ./
90+
build_prod:
91+
machine: true
92+
environment:
93+
CXX: g++-4.8
94+
DEPLOY_ENV: "PROD"
95+
LOGICAL_ENV: "prod"
96+
APPNAME: "topcoder-app"
97+
steps: *build_steps
98+
99+
build_qa:
100+
machine: true
101+
environment:
102+
CXX: g++-4.8
103+
DEPLOY_ENV: "QA"
104+
LOGICAL_ENV: "qa"
105+
APPNAME: "topcoder-app"
106+
steps: *build_steps
62107

63108
deploy_prod:
64109
<<: *python_env
65110
environment:
66111
DEPLOY_ENV: "PROD"
112+
LOGICAL_ENV: "prod"
113+
APPNAME: "topcoder-app"
67114
steps: *deploy_steps
68115

69116
deploy_dev:
70117
<<: *python_env
71118
environment:
72119
DEPLOY_ENV: "DEV"
120+
LOGICAL_ENV: "dev"
121+
APPNAME: "topcoder-app"
73122
steps: *deploy_steps
74123

75124
deploy_qa:
76125
<<: *python_env
77126
environemtn:
78127
DEPLOY_ENV: "QA"
128+
LOGICAL_ENV: "qa"
129+
APPNAME: "topcoder-app"
79130
steps: *deploy_steps
80131

81132
workflows:
82133
version: 2
83134
build-and-deploy:
84135
jobs:
85-
- build
136+
- build_dev:
137+
context : org-global
138+
filters:
139+
branches:
140+
only: [ dev, dev-circleci2 ]
141+
- build_qa:
142+
context : org-global
143+
filters:
144+
branches:
145+
only: qa-integration
146+
- build_prod:
147+
context : org-global
148+
filters:
149+
branches:
150+
only: master
86151
- deploy_dev:
152+
context : org-global
87153
filters:
88154
branches:
89155
only: [ dev, dev-circleci2 ]
90156
requires:
91-
- build
157+
- build_dev
92158
- deploy_prod:
159+
context : org-global
93160
filters:
94161
branches:
95162
only: master
96163
requires:
97-
- build
164+
- build_prod
98165
- deploy_qa:
166+
context : org-global
99167
filters:
100168
branches:
101169
only: qa-integration
102170
requires:
103-
- build
171+
- build_qa

0 commit comments

Comments
 (0)