Skip to content

Commit b4b3f1b

Browse files
authored
Merge pull request #23 from Purg/dev/container-registry
Added some docker tooling to push/pull from a gitlab contianer registry
2 parents af4fc8b + 81ab360 commit b4b3f1b

File tree

4 files changed

+95
-1
lines changed

4 files changed

+95
-1
lines changed

angel-docker-build.sh

+2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ function usage()
1111
echo "
1212
Usage: $0 [-h|--help] [--force]
1313
14+
Build the PTG ANGEL system docker container images.
15+
1416
Options:
1517
-h | --help Display this message.
1618
--force Force image building regardless of workspace hygiene.f

angel-docker-pull.sh

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
#!/bin/bash
2+
#
3+
# Pull the docker images.
4+
#
5+
set -e
6+
SCRIPT_DIR="$(cd "$(dirname "${0}")" && pwd)"
7+
pushd "$SCRIPT_DIR"
8+
9+
function usage()
10+
{
11+
echo "
12+
Usage: $0 [-h|--help]
13+
14+
Pull docker images from the registry configured via the environment parameters.
15+
16+
Options:
17+
-h | --help Display this message.
18+
"
19+
}
20+
21+
# Option parsing
22+
dc_forward_params=()
23+
while [[ $# -gt 0 ]]
24+
do
25+
case "$1" in
26+
-h|--help)
27+
usage
28+
exit 0
29+
;;
30+
*) # anything else
31+
dc_forward_params+=("$1")
32+
shift
33+
esac
34+
done
35+
36+
if [[ "${#dc_forward_params[@]}" -gt 0 ]]
37+
then
38+
# shellcheck disable=SC2145
39+
echo "Forwarding to docker-compose: ${dc_forward_params[@]}"
40+
fi
41+
42+
docker-compose \
43+
--env-file "$SCRIPT_DIR"/docker/.env \
44+
-f "$SCRIPT_DIR"/docker/docker-compose.yml \
45+
--profile build-only \
46+
pull "$@"

angel-docker-push.sh

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
#!/bin/bash
2+
#
3+
# Push the docker images.
4+
#
5+
set -e
6+
SCRIPT_DIR="$(cd "$(dirname "${0}")" && pwd)"
7+
pushd "$SCRIPT_DIR"
8+
9+
function usage()
10+
{
11+
echo "
12+
Usage: $0 [-h|--help]
13+
14+
Push docker images to the registry configured via the environment parameters.
15+
16+
Options:
17+
-h | --help Display this message.
18+
"
19+
}
20+
21+
# Option parsing
22+
dc_forward_params=()
23+
while [[ $# -gt 0 ]]
24+
do
25+
case "$1" in
26+
-h|--help)
27+
usage
28+
exit 0
29+
;;
30+
*) # anything else
31+
dc_forward_params+=("$1")
32+
shift
33+
esac
34+
done
35+
36+
if [[ "${#dc_forward_params[@]}" -gt 0 ]]
37+
then
38+
# shellcheck disable=SC2145
39+
echo "Forwarding to docker-compose: ${dc_forward_params[@]}"
40+
fi
41+
42+
docker-compose \
43+
--env-file "$SCRIPT_DIR"/docker/.env \
44+
-f "$SCRIPT_DIR"/docker/docker-compose.yml \
45+
--profile build-only \
46+
push "$@"

docker/.env

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
COMPOSE_PROJECT_NAME=angel-system
22

3-
PTG_REGISTRY=kitware/ptg-angel
3+
PTG_REGISTRY=gitlab.kitware.com:4567/ptg-angel/docker
44
PTG_TAG=latest
55

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

0 commit comments

Comments
 (0)