1
+ version : 2
2
+ defaults : &defaults
3
+ docker :
4
+ - image : circleci/node:15.5.1-stretch-browsers
5
+ install_dependency : &install_dependency
6
+ name : Installation of build and deployment dependencies.
7
+ command : |
8
+ sudo apt-get update
9
+ sudo apt install jq python3-pip
10
+ sudo pip3 install awscli --upgrade
11
+ sudo pip3 install docker-compose
12
+ install_deploysuite : &install_deploysuite
13
+ name : Installation of install_deploysuite.
14
+ command : |
15
+ git clone --branch v1.4.3 https://github.com/topcoder-platform/tc-deploy-scripts ../buildscript
16
+ cp ./../buildscript/master_deploy.sh .
17
+ cp ./../buildscript/buildenv.sh .
18
+ cp ./../buildscript/awsconfiguration.sh .
19
+ restore_cache_settings_for_build : &restore_cache_settings_for_build
20
+ key : docker-node-modules-{{ checksum "package-lock.json" }}
21
+
22
+ save_cache_settings : &save_cache_settings
23
+ key : docker-node-modules-{{ checksum "package-lock.json" }}
24
+ paths :
25
+ - node_modules
26
+
27
+ builddeploy_steps : &builddeploy_steps
28
+ - checkout
29
+ - setup_remote_docker
30
+ - run : *install_dependency
31
+ - run : *install_deploysuite
32
+ - restore_cache : *restore_cache_settings_for_build
33
+ - run : ./build.sh ${APPNAME}
34
+ - save_cache : *save_cache_settings
35
+ - deploy :
36
+ name : Running MasterScript.
37
+ command : |
38
+ ./awsconfiguration.sh $DEPLOY_ENV
39
+ source awsenvconf
40
+ ./buildenv.sh -e $DEPLOY_ENV -b ${LOGICAL_ENV}-${APPNAME}-deployvar
41
+ source buildenvvar
42
+ ./master_deploy.sh -d ECS -e $DEPLOY_ENV -t latest -s ${LOGICAL_ENV}-global-appvar,${LOGICAL_ENV}-${APPNAME}-appvar -i ${APPNAME}
43
+
44
+
45
+ jobs :
46
+ # Build & Deploy against development backend
47
+ " build-dev " :
48
+ << : *defaults
49
+ environment :
50
+ DEPLOY_ENV : " DEV"
51
+ LOGICAL_ENV : " dev"
52
+ APPNAME : " autopilot-processor"
53
+ steps : *builddeploy_steps
54
+
55
+ " build-prod " :
56
+ << : *defaults
57
+ environment :
58
+ DEPLOY_ENV : " PROD"
59
+ LOGICAL_ENV : " prod"
60
+ APPNAME : " autopilot-processor"
61
+ steps : *builddeploy_steps
62
+
63
+ workflows :
64
+ version : 2
65
+ build :
66
+ jobs :
67
+ # Development builds are executed on "develop" branch only.
68
+ - " build-dev " :
69
+ context : org-global
70
+ filters :
71
+ branches :
72
+ only :
73
+ - develop
74
+ - dev-circleci
75
+
76
+ # Production builds are exectuted only on tagged commits to the
77
+ # master branch.
78
+ - " build-prod " :
79
+ context : org-global
80
+ filters :
81
+ branches :
82
+ only : master
0 commit comments