-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #23 from Purg/dev/container-registry
Added some docker tooling to push/pull from a gitlab contianer registry
- Loading branch information
Showing
4 changed files
with
95 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters