forked from OPENDAP/hyrax-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmkDist
executable file
·92 lines (83 loc) · 3.11 KB
/
mkDist
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#!/bin/bash
###############################################################################################
#
# Make a docker distribution for a given Hyrax release.
#
#
# Some shell state reference:
# set -f # "set -o noglob" Disable file name generation using metacharacters (globbing).
# set -v # "set -o verbose" Prints shell input lines as they are read.
set -x # "set -o xtrace" Print command traces before executing command.
set -e # Exit on error.
#
# In general use "set -e" when running commands that matter and don't use
# it for debugging stuff.
#
###############################################################################################
#
# EDIT THIS SECTION TO REFLECT THE RELEASE VERSIONS OF THE VARIOUS COMPONENTS.
# DO NOT FORGET THE RELEASE DATE!
#
HYRAX_MAJOR_VERSION="1.16"
HYRAX_FULL_VERSION="1.16.5"
OLFS_VERSION="1.18.10"
LIBDAP_VERSION="3.20.9-0"
BES_VERSION="3.20.10-0"
RELEASE_DATE="2022-01-04"
#
###############################################################################################
DOCKER_RELEASE="hyrax-${HYRAX_FULL_VERSION}";
# Create release files from template
mkdir -p "${DOCKER_RELEASE}"
cp -R template/* "${DOCKER_RELEASE}"
#
# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
# Massage the files drawn from the template with the current version numbers.
#
containers="besd olfs hyrax ncWMS ngap"
for docker_container in ${containers}
do
cat template/${docker_container}/Dockerfile | \
sed -e "s/HYRAX_MAJOR_VERSION_TEMPLATE/${HYRAX_MAJOR_VERSION}/g" \
-e "s/HYRAX_FULL_VERSION_TEMPLATE/${HYRAX_FULL_VERSION}/g" \
-e "s/OLFS_VERSION_TEMPLATE/${OLFS_VERSION}/g" \
-e "s/BES_VERSION_TEMPLATE/${BES_VERSION}/g" \
-e "s/LIBDAP_VERSION_TEMPLATE/${LIBDAP_VERSION}/g" \
-e "s/RELEASE_DATE_TEMPLATE/${RELEASE_DATE}/g" \
> ${DOCKER_RELEASE}/$docker_container/Dockerfile
done
#
# Drop into release directory.
cd ${DOCKER_RELEASE}
#
# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
#
# Build the images using simple tags so they can be easily debugger'd
#
for docker_container in ${containers}
do
docker build -t `echo "${docker_container}" | tr '[:upper:]' '[:lower:]'` ${docker_container};
done
#
#
#
# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
#
# This builds the hyrax release images with the correct tags
#
docker build -t opendap/hyrax:${HYRAX_FULL_VERSION} hyrax;
docker build -t opendap/hyrax:latest hyrax;
#
docker build -t opendap/hyrax_ncwms:${HYRAX_FULL_VERSION} --build-arg USE_NCWMS=true hyrax;
docker build -t opendap/hyrax_ncwms:latest --build-arg USE_NCWMS=true hyrax;
#
docker build -t opendap/hyrax:ngap-${HYRAX_FULL_VERSION} ngap;
docker build -t opendap/hyrax:ngap-latest ngap;
#
#
# Return to top dir...
cd ..
#
###############################################################################################
###############################################################################################
###############################################################################################