File tree 2 files changed +33
-2
lines changed
2 files changed +33
-2
lines changed Original file line number Diff line number Diff line change @@ -16,12 +16,26 @@ install_deploysuite: &install_deploysuite
16
16
cp ./../buildscript/buildenv.sh .
17
17
cp ./../buildscript/awsconfiguration.sh .
18
18
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
+ run_build : &run_build
28
+ name : Building images
29
+ command : ./build.sh
30
+
19
31
build_steps : &build_steps
20
32
- checkout
21
33
- setup_remote_docker
22
34
- run : *install_dependency
23
35
- run : *install_deploysuite
24
- - run : ./build.sh
36
+ - restore_cache : *restore_cache_settings_for_build
37
+ - run : *run_build
38
+ - save_cache : *save_cache_settings
25
39
- deploy :
26
40
name : Running MasterScript.
27
41
command : |
Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
set -eo pipefail
3
+ UPDATE_CACHE=" "
3
4
echo " " > docker/api.env
4
5
docker-compose -f docker/docker-compose.yml build terms-service
5
- # docker images
6
+ # docker images
7
+ docker create --name app terms-service:latest
8
+ if [ -d node_modules ]
9
+ then
10
+ mv package-lock.json old-package-lock.json
11
+ docker cp app:/terms-service/package-lock.json package-lock.json
12
+ set +eo pipefail
13
+ UPDATE_CACHE=$( cmp package-lock.json old-package-lock.json)
14
+ set -eo pipefail
15
+ else
16
+ UPDATE_CACHE=1
17
+ fi
18
+
19
+ if [ " $UPDATE_CACHE " == 1 ]
20
+ then
21
+ docker cp app:/terms-service/node_modules .
22
+ fi
You can’t perform that action at this time.
0 commit comments