Skip to content

Commit

Permalink
Merge pull request #23 from Purg/dev/container-registry
Browse files Browse the repository at this point in the history
Added some docker tooling to push/pull from a gitlab contianer registry
  • Loading branch information
Purg authored Mar 7, 2022
2 parents af4fc8b + 81ab360 commit b4b3f1b
Show file tree
Hide file tree
Showing 4 changed files with 95 additions and 1 deletion.
2 changes: 2 additions & 0 deletions angel-docker-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ function usage()
echo "
Usage: $0 [-h|--help] [--force]
Build the PTG ANGEL system docker container images.
Options:
-h | --help Display this message.
--force Force image building regardless of workspace hygiene.f
Expand Down
46 changes: 46 additions & 0 deletions angel-docker-pull.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#!/bin/bash
#
# Pull the docker images.
#
set -e
SCRIPT_DIR="$(cd "$(dirname "${0}")" && pwd)"
pushd "$SCRIPT_DIR"

function usage()
{
echo "
Usage: $0 [-h|--help]
Pull docker images from the registry configured via the environment parameters.
Options:
-h | --help Display this message.
"
}

# Option parsing
dc_forward_params=()
while [[ $# -gt 0 ]]
do
case "$1" in
-h|--help)
usage
exit 0
;;
*) # anything else
dc_forward_params+=("$1")
shift
esac
done

if [[ "${#dc_forward_params[@]}" -gt 0 ]]
then
# shellcheck disable=SC2145
echo "Forwarding to docker-compose: ${dc_forward_params[@]}"
fi

docker-compose \
--env-file "$SCRIPT_DIR"/docker/.env \
-f "$SCRIPT_DIR"/docker/docker-compose.yml \
--profile build-only \
pull "$@"
46 changes: 46 additions & 0 deletions angel-docker-push.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#!/bin/bash
#
# Push the docker images.
#
set -e
SCRIPT_DIR="$(cd "$(dirname "${0}")" && pwd)"
pushd "$SCRIPT_DIR"

function usage()
{
echo "
Usage: $0 [-h|--help]
Push docker images to the registry configured via the environment parameters.
Options:
-h | --help Display this message.
"
}

# Option parsing
dc_forward_params=()
while [[ $# -gt 0 ]]
do
case "$1" in
-h|--help)
usage
exit 0
;;
*) # anything else
dc_forward_params+=("$1")
shift
esac
done

if [[ "${#dc_forward_params[@]}" -gt 0 ]]
then
# shellcheck disable=SC2145
echo "Forwarding to docker-compose: ${dc_forward_params[@]}"
fi

docker-compose \
--env-file "$SCRIPT_DIR"/docker/.env \
-f "$SCRIPT_DIR"/docker/docker-compose.yml \
--profile build-only \
push "$@"
2 changes: 1 addition & 1 deletion docker/.env
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
COMPOSE_PROJECT_NAME=angel-system

PTG_REGISTRY=kitware/ptg-angel
PTG_REGISTRY=gitlab.kitware.com:4567/ptg-angel/docker
PTG_TAG=latest

# Directory for the workspace shell to mount files and directories into on the
Expand Down

0 comments on commit b4b3f1b

Please sign in to comment.