@@ -9,95 +9,163 @@ python_env: &python_env
9
9
install_awscli : &install_awscli
10
10
name : " Install awscli"
11
11
command : |
12
- sudo pip install awscli awsebcli --upgrade
12
+ sudo pip install awscli --upgrade
13
+ sudo apt install jq
13
14
aws --version
14
- eb --version
15
15
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
16
36
# Instructinos of deployment
17
37
deploy_steps : &deploy_steps
18
38
- attach_workspace :
19
39
at : .
20
40
- run : *install_awscli
41
+ - run : *install_deploysuite
21
42
- 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
23
52
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
24
61
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
+
25
80
jobs :
26
- build :
81
+ build_dev :
27
82
machine : true
28
83
environment :
29
84
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
46
89
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
62
107
63
108
deploy_prod :
64
109
<< : *python_env
65
110
environment :
66
111
DEPLOY_ENV : " PROD"
112
+ LOGICAL_ENV : " prod"
113
+ APPNAME : " topcoder-app"
67
114
steps : *deploy_steps
68
115
69
116
deploy_dev :
70
117
<< : *python_env
71
118
environment :
72
119
DEPLOY_ENV : " DEV"
120
+ LOGICAL_ENV : " dev"
121
+ APPNAME : " topcoder-app"
73
122
steps : *deploy_steps
74
123
75
124
deploy_qa :
76
125
<< : *python_env
77
126
environemtn :
78
127
DEPLOY_ENV : " QA"
128
+ LOGICAL_ENV : " qa"
129
+ APPNAME : " topcoder-app"
79
130
steps : *deploy_steps
80
131
81
132
workflows :
82
133
version : 2
83
134
build-and-deploy :
84
135
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
86
151
- deploy_dev :
152
+ context : org-global
87
153
filters :
88
154
branches :
89
155
only : [ dev, dev-circleci2 ]
90
156
requires :
91
- - build
157
+ - build_dev
92
158
- deploy_prod :
159
+ context : org-global
93
160
filters :
94
161
branches :
95
162
only : master
96
163
requires :
97
- - build
164
+ - build_prod
98
165
- deploy_qa :
166
+ context : org-global
99
167
filters :
100
168
branches :
101
169
only : qa-integration
102
170
requires :
103
- - build
171
+ - build_qa
0 commit comments