1
1
version : 2
2
2
defaults : &defaults
3
- docker :
4
- - image : cimg/python:3.11.0-browsers
3
+ docker :
4
+ - image : cimg/python:3.11.0-browsers
5
5
install_dependency : &install_dependency
6
6
name : Installation of build and deployment dependencies.
7
7
command : |
@@ -13,7 +13,7 @@ install_dependency: &install_dependency
13
13
install_deploysuite : &install_deploysuite
14
14
name : Installation of install_deploysuite.
15
15
command : |
16
- git clone --branch v1.4 https://github.com/topcoder-platform/tc-deploy-scripts ../buildscript
16
+ git clone --branch v1.4.14 https://github.com/topcoder-platform/tc-deploy-scripts ../buildscript
17
17
cp ./../buildscript/master_deploy.sh .
18
18
cp ./../buildscript/buildenv.sh .
19
19
cp ./../buildscript/awsconfiguration.sh .
@@ -23,60 +23,77 @@ restore_cache_settings_for_build: &restore_cache_settings_for_build
23
23
save_cache_settings : &save_cache_settings
24
24
key : docker-node-modules-{{ checksum "yarn.lock" }}
25
25
paths :
26
- - node_modules
26
+ - node_modules
27
27
28
28
builddeploy_steps : &builddeploy_steps
29
- - checkout
30
- - setup_remote_docker
31
- - run : *install_dependency
32
- - run : *install_deploysuite
33
- - restore_cache : *restore_cache_settings_for_build
34
- - run : ./build.sh ${APPNAME}
35
- - save_cache : *save_cache_settings
36
- - deploy :
37
- name : Running MasterScript.
38
- command : |
39
- ./awsconfiguration.sh $DEPLOY_ENV
40
- source awsenvconf
41
- ./buildenv .sh -e $DEPLOY_ENV -b ${LOGICAL_ENV}-${APPNAME}-deployvar
42
- source buildenvvar
43
- ./master_deploy .sh -d ECS - e $DEPLOY_ENV -t latest -s ${LOGICAL_ENV}-global-appvar,${LOGICAL_ENV}-${ APPNAME}-appvar -i ${APPNAME}
44
-
45
-
29
+ - checkout
30
+ - setup_remote_docker
31
+ - run : *install_dependency
32
+ - run : *install_deploysuite
33
+ - restore_cache : *restore_cache_settings_for_build
34
+ - run :
35
+ name : " Authenticate with CodeArtifact and build docker image "
36
+ command : " ./awsconfiguration.sh ${CODEARTIFACT_ENV} \n source awsenvconf \n aws codeartifact login --tool npm --repository topcoder-framework --domain topcoder --domain-owner $AWS_ACCOUNT_ID --region $AWS_REGION --namespace @topcoder-framework \n cp ~/.npmrc . \n rm -f awsenvconf \n ./build.sh ${APPNAME} \n "
37
+ - save_cache : *save_cache_settings
38
+ - deploy :
39
+ name : Running MasterScript.
40
+ command : |
41
+ ./awsconfiguration .sh $DEPLOY_ENV
42
+ source awsenvconf
43
+ ./buildenv .sh -e $DEPLOY_ENV -b ${LOGICAL_ENV}-${ APPNAME}-deployvar
44
+ source buildenvvar
45
+ ./master_deploy.sh -d ECS -e $DEPLOY_ENV -t latest -s ${LOGICAL_ENV}-global-appvar,${LOGICAL_ENV}-${APPNAME}-appvar -i ${APPNAME}
46
46
jobs :
47
47
# Build & Deploy against development backend
48
48
" build-dev " :
49
- << : *defaults
49
+ !!merge <<: *defaults
50
50
environment :
51
51
DEPLOY_ENV : " DEV"
52
52
LOGICAL_ENV : " dev"
53
- APPNAME : " challenge-api"
53
+ APPNAME : " challenge-api"
54
+ CODEARTIFACT_ENV : " PROD"
55
+ steps : *builddeploy_steps
56
+
57
+ " build-qa " :
58
+ !!merge <<: *defaults
59
+ environment :
60
+ DEPLOY_ENV : " QA"
61
+ LOGICAL_ENV : " qa"
62
+ APPNAME : " challenge-api"
63
+ CODEARTIFACT_ENV : " PROD"
54
64
steps : *builddeploy_steps
55
65
56
66
" build-prod " :
57
- << : *defaults
67
+ !!merge <<: *defaults
58
68
environment :
59
69
DEPLOY_ENV : " PROD"
60
- LOGICAL_ENV : " prod"
61
- APPNAME : " challenge-api"
70
+ LOGICAL_ENV : " prod"
71
+ APPNAME : " challenge-api"
62
72
steps : *builddeploy_steps
63
73
64
74
workflows :
65
75
version : 2
66
76
build :
67
77
jobs :
68
- # Development builds are executed on "develop" branch only.
69
- - " build-dev " :
70
- context : org-global
71
- filters :
72
- branches :
73
- only :
74
- - dev
78
+ # Development builds are executed on "develop" branch only.
79
+ - " build-dev " :
80
+ context : org-global
81
+ filters :
82
+ branches :
83
+ only :
84
+ - dev
85
+
86
+ - " build-qa " :
87
+ context : org-global
88
+ filters :
89
+ branches :
90
+ only :
91
+ - refactor/domain-challenge
75
92
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
93
+ # Production builds are exectuted only on tagged commits to the
94
+ # master branch.
95
+ - " build-prod " :
96
+ context : org-global
97
+ filters :
98
+ branches :
99
+ only : master
0 commit comments