Begin Management in Docker
All checks were successful
Build and push Docker image at git tag / build (push) Successful in 26m48s
All checks were successful
Build and push Docker image at git tag / build (push) Successful in 26m48s
This commit is contained in:
36
build-mgmt.sh
Executable file
36
build-mgmt.sh
Executable file
@ -0,0 +1,36 @@
|
||||
#/bin/bash
|
||||
|
||||
# https://stackoverflow.com/a/4774063
|
||||
SCRIPTPATH="$(cd -- "$(dirname "$0")" >/dev/null 2>&1; pwd -P)"
|
||||
|
||||
source "$SCRIPTPATH/vars.sh"
|
||||
|
||||
requirements="requirements-frozen.txt"
|
||||
if [ "$1" != "-no-updates" ]; then
|
||||
echo "Update the depencendies in requirements.txt? [may break app] (y/n)"
|
||||
read newlockfile
|
||||
if [ "$newlockfile" == "y" ]; then
|
||||
requirements="requirements.txt"
|
||||
fi;
|
||||
fi;
|
||||
|
||||
for platform in $PLATFORMS; do
|
||||
if [ "$platform" != "gpu" ]; then
|
||||
docker build \
|
||||
--pull \
|
||||
--platform "linux/$platform" \
|
||||
--file "$SCRIPTPATH/docker-mgmt/Dockerfile" \
|
||||
--build-arg H_UID=1050 \
|
||||
--build-arg PIP_REQ_FILE="$requirements" \
|
||||
--build-arg H_GID=1050 \
|
||||
--tag "$IMAGE_REGISTRY/$IMAGE_OWNER/$IMAGE_NAME_MGMT:$platform" \
|
||||
"$SCRIPTPATH"
|
||||
fi;
|
||||
done;
|
||||
|
||||
if [ "$requirements" == "requirements.txt" ]; then
|
||||
# extract requirements-frozen.txt
|
||||
cid=$(docker create "$IMAGE_REGISTRY/$IMAGE_OWNER/$IMAGE_NAME_MGMT:arm64")
|
||||
docker cp "$cid:/ums-agenten/requirements.txt" "$SCRIPTPATH/docker-mgmt/requirements-frozen.txt"
|
||||
docker rm "$cid"
|
||||
fi;
|
Reference in New Issue
Block a user