-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpublish.sh
More file actions
executable file
·28 lines (22 loc) · 864 Bytes
/
Copy pathpublish.sh
File metadata and controls
executable file
·28 lines (22 loc) · 864 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/usr/bin/env bash
set -euo pipefail
version="${1:-}"
if [ -z "$version" ]; then
echo "Usage: OGM_IMAGE_REPOSITORIES='ghcr.io/owner/image [ghcr.io/owner/image]' $0 VERSION" >&2
exit 1
fi
read -r -a image_repositories <<< "${OGM_IMAGE_REPOSITORIES:-ghcr.io/ewlarson/opengeometadata-api}"
if [ "${#image_repositories[@]}" -eq 0 ]; then
echo "OGM_IMAGE_REPOSITORIES must contain at least one image repository." >&2
exit 1
fi
build_tags=()
for image_repository in "${image_repositories[@]}"; do
build_tags+=(--tag "$image_repository:$version" --tag "$image_repository:latest")
done
docker build "${build_tags[@]}" .
for image_repository in "${image_repositories[@]}"; do
docker push "$image_repository:$version"
docker push "$image_repository:latest"
echo "Published $image_repository:$version and $image_repository:latest"
done