@@ -2,19 +2,19 @@ version: 2
2
2
python_env : &python_env
3
3
docker :
4
4
- image : circleci/python:2.7-stretch-browsers
5
-
5
+
6
6
install_awscli : &install_awscli
7
7
name : " Install awscli"
8
8
command : |
9
9
sudo pip install awscli --upgrade
10
10
install_deploysuite : &install_deploysuite
11
- name : Installation of install_deploysuite.
12
- command : |
13
- git clone --branch master https://github.com/topcoder-platform/tc-deploy-scripts ../buildscript
14
- cp ./../buildscript/master_deploy.sh .
15
- cp ./../buildscript/buildenv.sh .
16
- cp ./../buildscript/awsconfiguration.sh .
17
-
11
+ name : Installation of install_deploysuite.
12
+ command : |
13
+ git clone --branch v1.4.1 https://github.com/topcoder-platform/tc-deploy-scripts ../buildscript
14
+ cp ./../buildscript/master_deploy.sh .
15
+ cp ./../buildscript/buildenv.sh .
16
+ cp ./../buildscript/awsconfiguration.sh .
17
+
18
18
# Instructions of deployment
19
19
deploy_steps : &deploy_steps
20
20
- checkout
@@ -23,22 +23,16 @@ deploy_steps: &deploy_steps
23
23
- run : *install_awscli
24
24
- run : *install_deploysuite
25
25
- setup_remote_docker
26
- - run : docker build -t tc-project-service :latest .
26
+ - run : docker build -t ${APPNAME} :latest .
27
27
- deploy :
28
- name : " Running Masterscript - deploy tc-project-service "
28
+ name : " Running Masterscript - deploy tc-project-service "
29
29
command : |
30
- ./awsconfiguration.sh $DEPLOY_ENV
30
+ ./awsconfiguration.sh $DEPLOY_ENV
31
31
source awsenvconf
32
- ./buildenv.sh -e $DEPLOY_ENV -b ${VAR_ENV}-tc-project-service -deployvar
32
+ ./buildenv.sh -e $DEPLOY_ENV -b ${LOGICAL_ENV}-${APPNAME} -deployvar
33
33
source buildenvvar
34
- ./master_deploy.sh -d ECS -e $DEPLOY_ENV -t latest -s ${VAR_ENV }-global-appvar,${VAR_ENV}-tc-project-service- appvar -i tc-project-service -p FARGATE
34
+ ./master_deploy.sh -d ECS -e $DEPLOY_ENV -t latest -s ${LOGICAL_ENV }-global-appvar,${LOGICAL_ENV}-${APPNAME}- appvar -i ${APPNAME}
35
35
36
- echo "======= Running Masterscript - deploy tc-project-service-consumers ==========="
37
- if [ -e ${VAR_ENV}-tc-project-service-appvar.json ]; then sudo rm -vf ${VAR_ENV}-tc-project-service-appvar.json; fi
38
- ./buildenv.sh -e $DEPLOY_ENV -b ${VAR_ENV}-tc-project-service-consumers-deployvar
39
- source buildenvvar
40
- ./master_deploy.sh -d ECS -e $DEPLOY_ENV -t latest -s ${VAR_ENV}-global-appvar,${VAR_ENV}-tc-project-service-appvar -i tc-project-service -p FARGATE
41
-
42
36
jobs :
43
37
test :
44
38
docker :
@@ -50,13 +44,20 @@ jobs:
50
44
- image : elasticsearch:2.3
51
45
- image : rabbitmq:3-management
52
46
environment :
53
- DB_MASTER_URL : postgres://circle_test:@127.0.0.1:5432/circle_test
54
- AUTH_SECRET : secret
55
- AUTH_DOMAIN : topcoder-dev.com
56
- LOG_LEVEL : debug
57
- APP_VERSION : v4
47
+ DEPLOY_ENV : " DEV"
48
+ LOGICAL_ENV : " dev"
49
+ APPNAME : " projects-api"
58
50
steps :
59
51
- checkout
52
+ - run :
53
+ name : " Install dependeency"
54
+ command : |
55
+ sudo apt update
56
+ sudo apt install curl
57
+ sudo apt install python-pip
58
+ - run : *install_awscli
59
+ - run : *install_deploysuite
60
+ - setup_remote_docker
60
61
- restore_cache :
61
62
key : test-node-modules-{{ checksum "package.json" }}
62
63
- run : npm install
@@ -65,39 +66,50 @@ jobs:
65
66
paths :
66
67
- node_modules
67
68
- run : npm run lint
68
- - run : npm run test
69
+ - run :
70
+ name : " Running Masterscript - deploy tc-project-service "
71
+ command : |
72
+ ./awsconfiguration.sh $DEPLOY_ENV
73
+ source awsenvconf
74
+ ./buildenv.sh -e $DEPLOY_ENV -b ${LOGICAL_ENV}-${APPNAME}-testvar
75
+ source buildenvvar
76
+ npm run test
77
+ rm -f buildenvvar
69
78
- run : npm run build
70
79
- persist_to_workspace :
71
80
root : .
72
81
paths :
73
82
- dist
74
-
83
+
75
84
deployProd :
76
85
<< : *python_env
77
86
environment :
78
87
DEPLOY_ENV : " PROD"
79
- VAR_ENV : " prod"
88
+ LOGICAL_ENV : " prod"
89
+ APPNAME : " projects-api"
80
90
steps : *deploy_steps
81
91
82
92
deployDev :
83
93
<< : *python_env
84
94
environment :
85
95
DEPLOY_ENV : " DEV"
86
- VAR_ENV : " dev"
87
- steps : *deploy_steps
88
-
96
+ LOGICAL_ENV : " dev"
97
+ APPNAME : " projects-api"
98
+ steps : *deploy_steps
99
+
89
100
workflows :
90
101
version : 2
91
102
build :
92
103
jobs :
93
- - test
104
+ - test :
105
+ context : org-global
94
106
- deployDev :
95
107
context : org-global
96
108
requires :
97
109
- test
98
110
filters :
99
111
branches :
100
- only : ['dev', 'dev-sts', 'feature/looker-api-integration ']
112
+ only : ['develop ']
101
113
- deployProd :
102
114
context : org-global
103
115
requires :
0 commit comments