Skip to content

Commit

Permalink
for idaholab#389, used tagged images
Browse files Browse the repository at this point in the history
  • Loading branch information
mmguero committed May 9, 2024
1 parent 7b69dab commit d2de21b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions scripts/github_image_helper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ if ! (type "$REALPATH" && type "$DIRNAME" && type "$GREP" && type git) > /dev/nu
exit 1
fi
SCRIPT_PATH="$($DIRNAME $($REALPATH -e "${BASH_SOURCE[0]}"))"
IMAGE_ARCH_SUFFIX="$(uname -m | sed 's/x86_64//' | sed 's/aarch64/-arm64/')"

set -uo pipefail
shopt -s nocasematch
Expand Down Expand Up @@ -105,15 +106,15 @@ function _PullAndTagGithubWorkflowBuild() {
OWNER="$(_gitowner)"
IMAGE=$1

docker pull $QUIET_PULL_FLAG ghcr.io/"$OWNER"/"$IMAGE":"$BRANCH" && \
docker tag ghcr.io/"$OWNER"/"$IMAGE":"$BRANCH" ghcr.io/idaholab/"$IMAGE":"$VERSION"
docker pull $QUIET_PULL_FLAG ghcr.io/"$OWNER"/"$IMAGE":"${BRANCH}${IMAGE_ARCH_SUFFIX}" && \
docker tag ghcr.io/"$OWNER"/"$IMAGE":"$BRANCH" ghcr.io/idaholab/"$IMAGE":"${VERSION}${IMAGE_ARCH_SUFFIX}"
}

function PullAndTagGithubWorkflowImages() {
BRANCH="$(_gitbranch)"
VERSION="$(_malcolmversion)"
OWNER="$(_gitowner)"
echo "Pulling images from ghcr.io/$OWNER ($BRANCH) and tagging as $VERSION ..."
echo "Pulling images from ghcr.io/$OWNER ($BRANCH) and tagging as ${VERSION}${IMAGE_ARCH_SUFFIX}..."
for IMG in $($GREP image: "$(_gittoplevel)"/docker-compose.yml | _cols 2 | cut -d: -f1 | sort -u | sed "s/.*\/\(malcolm\)/\1/"); do
_PullAndTagGithubWorkflowBuild "$IMG"
done
Expand Down

0 comments on commit d2de21b

Please sign in to comment.