45 lines
912 B
Bash
Executable File
45 lines
912 B
Bash
Executable File
#!/bin/bash
|
|
|
|
# Determine if it is Mac OS and switch to use gxargs instead
|
|
CMD=xargs
|
|
if [ $(which system_profiler) ]; then
|
|
CMD=gxargs
|
|
fi
|
|
|
|
# Bring in the variables from SOLUTION file, supporting
|
|
# nested substitution
|
|
. SOLUTION
|
|
. MANIFEST
|
|
|
|
export $(sed -nE "s,(^[^#][^=]*).*$,\1,pg" SOLUTION | ${CMD} -d '\n')
|
|
export $(sed -nE "s,(^[^#][^=]*).*$,\1,pg" MANIFEST | ${CMD} -d '\n')
|
|
|
|
AGAMA_VERSION=${AGAMA_VERSION:-N/A}
|
|
[[ "${AGAMA_VERSION}" == "N/A" ]] && {
|
|
TAG=${TAG:-test-build-${PACKAGE_STREAM}-$(date +%Y%m%d)}
|
|
} || {
|
|
TAG=${TAG:-test-agama-${AGAMA_VERSION}}
|
|
}
|
|
|
|
docker build -t ${CONTAINER}:${TAG} . $* || {
|
|
cat << EOM
|
|
|
|
Building docker image failed.
|
|
|
|
EOM
|
|
exit $?
|
|
}
|
|
|
|
docker tag ${CONTAINER}:${TAG} ${CONTAINER}
|
|
rc=$?
|
|
if [ $rc -ne 0 ]; then
|
|
exit 1
|
|
fi
|
|
|
|
cat << EOM
|
|
This image was built and locally tagged as ${CONTAINER}:${TAG}
|
|
|
|
See 'scripts/push-images' for information on pushing this tag to Harbor.
|
|
|
|
EOM
|