forked from andrealenzi11/py-poppleract
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build_script.sh
28 lines (23 loc) · 941 Bytes
/
build_script.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
#!/bin/bash
VERSION=$(python3 -c "import sys, json; print(json.load(sys.stdin)['version'])" < 'version.json')
BASE_IMAGE_NAME=andrealenzi/poppleract-base:23.12_5.3.3
SERVICES_IMAGE_NAME=andrealenzi/poppleract-services:${VERSION}
echo "(*) VERSION:" "${VERSION}"
echo "(*) BASE_IMAGE_NAME:" "${BASE_IMAGE_NAME}"
echo "(*) SERVICES_IMAGE_NAME:" "${SERVICES_IMAGE_NAME}"
echo -e "\n >>> Building base image ..."
if docker image inspect "${BASE_IMAGE_NAME}" >/dev/null 2>&1; then
echo "- Base image already exists locally!"
else
docker build -t "${BASE_IMAGE_NAME}" -f base.Dockerfile .
fi
echo -e "\n >>> Building services image ..."
if docker image inspect "${SERVICES_IMAGE_NAME}" >/dev/null 2>&1; then
echo "- Services image already exists locally!"
else
docker build -t "${SERVICES_IMAGE_NAME}" -f services.Dockerfile .
fi
# docker login
# docker push "${BASE_IMAGE_NAME}"
# docker push "${SERVICES_IMAGE_NAME}"
exit 0