Skip to content

Commit 1170985

Browse files
author
Vikas Agarwal
committed
Merge branch 'master' into hotfix/unable_to_activate_v2_projects
2 parents 8cedb9c + 7019a9d commit 1170985

File tree

1 file changed

+87
-71
lines changed

1 file changed

+87
-71
lines changed

.circleci/config.yml

Lines changed: 87 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -1,121 +1,137 @@
11
version: 2
2-
jobs:
3-
test:
2+
defaults: &defaults
43
docker:
54
- image: circleci/node:8.9.4-browsers
6-
steps:
7-
- run:
8-
name: installing dependency
5+
deploy_defaults: &deploy_defaults
6+
docker:
7+
- image: cibuilds/aws
8+
install_dependency: &install_dependency
9+
name: Installation of build and deployment dependencies.
910
command: |
1011
sudo apt install python-dev python-pip -y
11-
sudo pip install awscli --upgrade
12-
- run:
13-
name: checking out tc-deploy for environment
12+
sudo pip install awscli --upgrade
13+
install_deploysuite: &install_deploysuite
14+
name: Installation of install_deploysuite.
1415
command: |
15-
git clone --branch v1.2 https://github.com/topcoder-platform/tc-deploy-scripts ../buildscript
16-
- checkout
17-
- restore_cache:
16+
git clone --branch v1.3 https://github.com/topcoder-platform/tc-deploy-scripts ../buildscript
17+
cp ./../buildscript/master_deploy.sh .
18+
cp ./../buildscript/buildenv.sh .
19+
cp ./../buildscript/awsconfiguration.sh .
20+
restore_cache_settings_for_build: &restore_cache_settings_for_build
1821
key: test-node-modules-{{ .Environment.CACHE_VERSION }}-{{ checksum "package-lock.json" }}
19-
- run: npm install
20-
- save_cache:
22+
save_cache_settings: &save_cache_settings
2123
key: test-node-modules-{{ .Environment.CACHE_VERSION }}-{{ checksum "package-lock.json" }}
2224
paths:
2325
- node_modules
24-
- run:
25-
name: checking out tc-deploy for environment
26+
running_npm_build: &running_npm_build
27+
name: Running Npm Build
2628
command: |
27-
cp ./../buildscript/buildenv.sh .
28-
./buildenv.sh -e DEV -b dev-connectapp-buildvar
29-
./buildenv.sh -e PROD -b prod-connectapp-buildvar
3029
source buildenvvar
3130
npm run lint
3231
npm run test
33-
npm run build
34-
- persist_to_workspace:
32+
npm run build
33+
workspace_persist: &workspace_persist
3534
root: .
3635
paths:
37-
- dist
36+
- dist
37+
workspace_attach: &workspace_attach
38+
at: ./workspace
39+
jobs:
40+
build-dev:
41+
<<: *defaults
42+
steps:
43+
# Initialization.
44+
- checkout
45+
- setup_remote_docker
46+
- run: *install_dependency
47+
- run: *install_deploysuite
48+
- restore_cache: *restore_cache_settings_for_build
49+
- run: npm install
50+
- save_cache: *save_cache_settings
51+
- run:
52+
name: "configuring environment"
53+
command: |
54+
./awsconfiguration.sh DEV
55+
./buildenv.sh -e DEV -b dev-connectapp-buildvar
56+
- run: *running_npm_build
57+
- persist_to_workspace: *workspace_persist
58+
59+
build-prod:
60+
<<: *defaults
61+
steps:
62+
# Initialization.
63+
- checkout
64+
- setup_remote_docker
65+
- run: *install_dependency
66+
- run: *install_deploysuite
67+
- restore_cache: *restore_cache_settings_for_build
68+
- run: npm install
69+
- save_cache: *save_cache_settings
70+
- run:
71+
name: "configuring environment"
72+
command: |
73+
./awsconfiguration.sh PROD
74+
./buildenv.sh -e PROD -b prod-connectapp-buildvar
75+
- run: *running_npm_build
76+
- persist_to_workspace: *workspace_persist
3877

3978
# Just tests commited code.
4079
deployDev:
41-
docker:
42-
- image: cibuilds/aws
80+
<<: *deploy_defaults
4381
steps:
4482
- checkout
45-
- attach_workspace:
46-
at: ./workspace
83+
- attach_workspace: *workspace_attach
84+
- run: *install_deploysuite
4785
- deploy:
4886
name: Running MasterScript
4987
command: |
50-
git clone --branch v1.2 https://github.com/topcoder-platform/tc-deploy-scripts ../buildscript
51-
cp ./../buildscript/master_deploy.sh .
52-
cp ./../buildscript/buildenv.sh .
88+
./awsconfiguration.sh DEV
89+
source awsenvconf
5390
./buildenv.sh -e DEV -b dev-connectapp-deployvar
5491
source buildenvvar
5592
./master_deploy.sh -d CFRONT -e DEV -c false
56-
# deploy to test02
57-
deployTest02:
58-
docker:
59-
- image: cibuilds/aws
60-
steps:
61-
- checkout
62-
- attach_workspace:
63-
at: ./workspace
64-
- run: ./deploy.sh TEST02 no-cache
65-
6693
deployProd:
67-
docker:
68-
- image: cibuilds/aws
94+
<<: *deploy_defaults
6995
steps:
7096
- checkout
71-
- attach_workspace:
72-
at: ./workspace
97+
- attach_workspace: *workspace_attach
98+
- run: *install_deploysuite
7399
- deploy:
74100
name: Running MasterScript
75101
command: |
76-
git clone --branch v1.2 https://github.com/topcoder-platform/tc-deploy-scripts ../buildscript
77-
cp ./../buildscript/master_deploy.sh .
78-
cp ./../buildscript/buildenv.sh .
102+
./awsconfiguration.sh PROD
103+
source awsenvconf
79104
./buildenv.sh -e PROD -b prod-connectapp-deployvar
80105
source buildenvvar
81106
./master_deploy.sh -d CFRONT -e PROD -c true
82-
83-
deployDiscourseFree:
84-
docker:
85-
- image: cibuilds/aws
86-
steps:
87-
- checkout
88-
- attach_workspace:
89-
at: ./workspace
90-
- run: ./deploy.sh DISCOURSE
91-
92-
93107
workflows:
94108
version: 2
95109
build:
96110
jobs:
97-
- test
98-
- deployDev:
99-
requires:
100-
- test
111+
- build-dev:
112+
context : org-global
101113
filters:
102114
branches:
103-
only: ['dev', 'dev-msinteg', 'feature/attachmentPermissions']
104-
- deployTest02:
105-
requires:
106-
- test
115+
only: ['dev', 'dev-msinteg', 'feature/form-redesign']
116+
117+
- build-prod:
118+
context : org-global
107119
filters:
108120
branches:
109-
only: "feature/discourse-migration"
110-
- deployProd:
121+
only: master
122+
123+
- deployDev:
124+
context : org-global
111125
requires:
112-
- test
126+
- build-dev
113127
filters:
114128
branches:
115-
only: master
116-
- deployDiscourseFree:
129+
only: ['dev', 'dev-msinteg', 'feature/form-redesign']
130+
131+
- deployProd:
132+
context : org-global
117133
requires:
118-
- test
134+
- build-prod
119135
filters:
120136
branches:
121-
only: master-discourse-free
137+
only: master

0 commit comments

Comments
 (0)