This repository was archived by the owner on Mar 13, 2025. It is now read-only.
File tree 2 files changed +29
-3
lines changed
2 files changed +29
-3
lines changed Original file line number Diff line number Diff line change @@ -29,29 +29,31 @@ builddeploy_steps: &builddeploy_steps
29
29
- run : *install_dependency
30
30
- run : *install_deploysuite
31
31
- restore_cache : *restore_cache_settings_for_build
32
- - run : docker build -t topcoder-x-receiver:latest .
32
+ - run : ./builddocker.sh ${APPNAME}
33
33
- save_cache : *save_cache_settings
34
34
- deploy :
35
35
name : Running MasterScript.
36
36
command : |
37
37
./awsconfiguration.sh $DEPLOY_ENV
38
38
source awsenvconf
39
- ./buildenv.sh -e $DEPLOY_ENV -b ${DEPLOY_ENV}-topcoder-x-receiver -deployvar
39
+ ./buildenv.sh -e $DEPLOY_ENV -b ${DEPLOY_ENV}-${APPNAME} -deployvar
40
40
source buildenvvar
41
- ./master_deploy.sh -d ECS -e $DEPLOY_ENV -t latest -s dev -global-appvar,${DEPLOY_ENV}-topcoder-x-receiver- appvar -i topcoder-x-receiver
41
+ ./master_deploy.sh -d ECS -e $DEPLOY_ENV -t latest -s ${DEPLOY_ENV} -global-appvar,${DEPLOY_ENV}-${APPNAME}- appvar -i ${APPNAME}
42
42
jobs :
43
43
# Build & Deploy against development backend
44
44
" build-dev " :
45
45
<< : *defaults
46
46
environment :
47
47
DEPLOY_ENV : " dev"
48
+ APPNAME : " topcoder-x-receiver"
48
49
steps : *builddeploy_steps
49
50
50
51
# Build & Deploy against production backend
51
52
" build-prod " :
52
53
<< : *defaults
53
54
environment :
54
55
DEPLOY_ENV : " prod"
56
+ APPNAME : " topcoder-x-receiver"
55
57
steps : *builddeploy_steps
56
58
57
59
workflows :
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ set -eo pipefail
3
+ APP_NAME=$1
4
+ UPDATE_CACHE=" "
5
+ echo " " > docker/api.env
6
+ # docker-compose -f docker/docker-compose.yml build $APP_NAME
7
+ docker build -t $APP_NAME :latest .
8
+ docker create --name app $APP_NAME :latest
9
+
10
+ if [ -d node_modules ]
11
+ then
12
+ mv package-lock.json old-package-lock.json
13
+ docker cp app:/$APP_NAME /package-lock.json package-lock.json
14
+ set +eo pipefail
15
+ UPDATE_CACHE=$( cmp package-lock.json old-package-lock.json)
16
+ set -eo pipefail
17
+ else
18
+ UPDATE_CACHE=1
19
+ fi
20
+
21
+ if [ " $UPDATE_CACHE " == 1 ]
22
+ then
23
+ docker cp app:/$APP_NAME /node_modules .
24
+ fi
You can’t perform that action at this time.
0 commit comments