-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathbuild
executable file
·44 lines (33 loc) · 963 Bytes
/
build
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
#! /bin/bash
#
# Usage:
# build
#
# Builds docker images with the provided configuration values via config.inc.
cfg=config.inc
set -o errexit -o nounset -o pipefail
if [[ "$OSTYPE" == "darwin"* ]]
then
readonly ExecName=$(greadlink -f "$0")
else
readonly ExecName=$(readlink --canonicalize "$0")
fi
main()
{
local baseDir=$(dirname "$ExecName")
if [ -z "$cfg" ]
then
printf 'An environment variable include file is needed.\n' >&2
return 1
fi
. "$baseDir/$cfg"
docker build --file "$baseDir"/base/Dockerfile.centos7 --tag irods-docker-deploy-centos7 "$baseDir"
docker build --file "$baseDir"/base/Dockerfile.ubuntu2004 --tag irods-docker-deploy-ubuntu2004 \
"$baseDir"
if ! command -v docker-compose > /dev/null; then
docker compose --file "$baseDir"/docker-compose.yml --project-name "$ENV_NAME" build
else
docker-compose --file "$baseDir"/docker-compose.yml --project-name "$ENV_NAME" build
fi
}
main "$@"