Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Commit eaa423d

Browse files
author
Dushyant
committed
Added build.sh file
1 parent 4669a48 commit eaa423d

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

build.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/bash
2+
set -eo pipefail
3+
UPDATE_CACHE=""
4+
docker-compose -f docker/docker-compose.yml build leaderboard-processor
5+
docker create --name app leaderboard-processor:latest
6+
7+
if [ -d node_modules ]
8+
then
9+
mv package-lock.json old-package-lock.json
10+
docker cp app:/leaderboard-processor/package-lock.json package-lock.json
11+
set +eo pipefail
12+
UPDATE_CACHE=$(cmp package-lock.json old-package-lock.json)
13+
set -eo pipefail
14+
else
15+
UPDATE_CACHE=1
16+
fi
17+
18+
if [ "$UPDATE_CACHE" == 1 ]
19+
then
20+
docker cp app:/leaderboard-processor/node_modules .
21+
fi

0 commit comments

Comments
 (0)