-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.sh
executable file
·52 lines (48 loc) · 1.18 KB
/
build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/bin/sh
backend_version=""
frontend_version=""
push_images=false
# Parse command-line arguments
for arg in "$@"
do
case $arg in
--backend=*)
backend_version="${arg#*=}"
shift
;;
--frontend=*)
frontend_version="${arg#*=}"
shift
;;
--push)
push_images=true
shift
;;
esac
done
if [ -n "$backend_version" ]; then
(
if [ ! -d "blockscout" ]; then
git clone https://github.com/aurora-is-near/blockscout
fi
cd blockscout
git pull origin master
docker build --file docker/Dockerfile --build-arg=RELEASE_VERSION=$backend_version --tag "nearaurora/blockscout:$backend_version" .
if [ "$push_images" = true ]; then
docker push nearaurora/blockscout:$backend_version
fi
)
fi
if [ -n "$frontend_version" ]; then
(
if [ ! -d "blockscout-frontend" ]; then
git clone https://github.com/aurora-is-near/blockscout-frontend
fi
cd blockscout-frontend
git pull origin main
docker build --file Dockerfile --tag "nearaurora/blockscout-frontend:$frontend_version" .
if [ "$push_images" = true ]; then
docker push nearaurora/blockscout-frontend:$frontend_version
fi
)
fi