forked from isard-vdi/isard
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild-docker-images.sh
More file actions
executable file
·50 lines (42 loc) · 971 Bytes
/
build-docker-images.sh
File metadata and controls
executable file
·50 lines (42 loc) · 971 Bytes
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
#!/usr/bin/env bash
# Check that the version number was provided
if [ -z "$1" ]; then
echo "You need to specify a IsardVDI version! e.g. '1.1.0'"
exit 1
fi
if [ $1 = "-f" ]; then
force=1
if [ -z "$2" ]; then
echo "You need to specify a IsardVDI version with -f option! e.g. '1.1.0'"
exit 1
fi
version=$2
else
force=0
version=$1
fi
MAJOR=${version:0:1}
MINOR=${version:0:3}
PATCH=$version
# If a command fails, the whole script is going to stop
set -e
# Checkout to the specified version tag
if [ force = 1 ]; then
git checkout $1 > /dev/null
fi
# Array containing all the images to build
images=(
#grafana
nginx
hypervisor
app
)
# Build all the images and tag them correctly
for image in "${images[@]}"; do
echo -e "\n\n\n"
echo "Building $image"
echo -e "\n\n\n"
cmd="docker build -f dockers/$image/Dockerfile -t isard/$image:latest -t isard/$image:$MAJOR -t isard/$image:$MINOR -t isard/$image:$PATCH ."
echo $cmd
$cmd
done