Skip to content

Commit

Permalink
Migrate remaining GCR occurrences to GAR (#221)
Browse files Browse the repository at this point in the history
  • Loading branch information
8R0WNI3 authored Jul 23, 2024
1 parent 127d58a commit 9de9c65
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .ci/pipeline_definitions
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ gardener-website-generator:
head-update:
steps:
build:
image: 'eu.gcr.io/gardener-project/gardener-website-generator:10.46.0'
image: 'europe-docker.pkg.dev/gardener-project/releases/gardener-website-generator:10.46.0'
vars:
PUBLISH: "'true'"
LOCAL_BUILD: "'false'"
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM eu.gcr.io/gardener-project/3rd/alpine:3.12.1 as base
FROM europe-docker.pkg.dev/gardener-project/releases/3rd/alpine:3.20.1 as base

RUN apk add curl

Expand All @@ -12,8 +12,8 @@ RUN curl -fsSLO --compressed https://github.com/gohugoio/hugo/releases/download/
&& mkdir -p /usr/local/bin \
&& mv ./hugo /usr/local/bin/hugo

FROM eu.gcr.io/gardener-project/docforge:v0.46.0 as docforge
FROM registry-1.docker.io/gardenerci/cc-job-image:1.1299.0
FROM europe-docker.pkg.dev/gardener-project/releases/docforge:v0.46.0 as docforge
FROM europe-docker.pkg.dev/gardener-project/releases/cicd/job-image:latest

COPY --from=docforge /docforge /usr/local/bin/docforge
COPY --from=base /usr/local/bin/hugo /usr/local/bin/hugo
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,14 @@ build-local:
.PHONY: image-build
image-build:
@scripts/image-build
# `make image-push` pushes a local image to the project GCR repository. An installed and authenticated gcloud tool
# `make image-push` pushes a local image to the project GAR repository. An installed and authenticated gcloud tool
# is required to perform the operation. The image to push is identified by its tag. Use semver for tags. Tag `latest`
# is automatically assigned in addition.
# Example: `$ make image-push TAG=10.0.0`
.PHONY: image-push
image-push:
@scripts/image-push
# `make image-stable` pushes a local image to the project GCR repository with tag :stable. An installed and authenticated gcloud tool
# `make image-stable` pushes a local image to the project GAR repository with tag :stable. An installed and authenticated gcloud tool
# is required to perform the operation. The image to push is identified by its tag. Use semver for tags.
# Example: `$ make image-stable TAG=10.0.0`
.PHONY: image-stable
Expand Down
9 changes: 5 additions & 4 deletions scripts/image-build
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@

set -ex

# GCR coordinates
HOST=eu.gcr.io
# GAR coordinates
HOST=europe-docker.pkg.dev
PROJECT=gardener-project
REPOSITORY=releases
IMAGE=gardener-website-generator

for i in "$@"
Expand Down Expand Up @@ -37,5 +38,5 @@ fi

ctxpath="$(${READLINK_BIN} -f "$(dirname "${0}")/..")"

echo "Building $HOST/$PROJECT/$IMAGE tagged as :$TAG and :latest"
docker build --no-cache=true -t "$HOST/$PROJECT/$IMAGE:$TAG" -t "$HOST/$PROJECT/$IMAGE:latest" "$ctxpath" | tee /tmp/docker_build_result.log
echo "Building $HOST/$PROJECT/$REPOSITORY/$IMAGE tagged as :$TAG and :latest"
docker build --no-cache=true -t "$HOST/$PROJECT/$REPOSITORY/$IMAGE:$TAG" -t "$HOST/$PROJECT/$REPOSITORY/$IMAGE:latest" "$ctxpath" | tee /tmp/docker_build_result.log
9 changes: 5 additions & 4 deletions scripts/image-push
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@

set -ex

HOST=eu.gcr.io
HOST=europe-docker.pkg.dev
PROJECT=gardener-project
REPOSITORY=releases
IMAGE=gardener-website-generator
for i in "$@"
do
Expand All @@ -20,6 +21,6 @@ if [[ -z "${TAG}" ]]; then
exit 1;
fi

echo "Pushing image to GCR. Tagged as :latest and :${TAG}"
docker push "$HOST/$PROJECT/$IMAGE:$TAG"
docker push "$HOST/$PROJECT/$IMAGE:latest"
echo "Pushing image to GAR. Tagged as :latest and :${TAG}"
docker push "$HOST/$PROJECT/$REPOSITORY/$IMAGE:$TAG"
docker push "$HOST/$PROJECT/$REPOSITORY/$IMAGE:latest"
7 changes: 4 additions & 3 deletions scripts/image-stable
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@

set -ex

HOST=eu.gcr.io
HOST=europe-docker.pkg.dev
PROJECT=gardener-project
REPOSITORY=releases
IMAGE=gardener-website-generator
for i in "$@"
do
Expand All @@ -20,7 +21,7 @@ if [[ -z "${TAG}" ]]; then
exit 1;
fi

IMAGE="${HOST}/${PROJECT}/${IMAGE}"
IMAGE="${HOST}/${PROJECT}/${REPOSITORY}/${IMAGE}"
foundImage=$(docker images "${IMAGE}:${TAG}" | tail -n +2)
if [[ -z "${foundImage}" ]]; then
echo "Pulling locally image ${IMAGE}:${TAG}"
Expand All @@ -30,5 +31,5 @@ fi
echo "Tagging image with tag ${TAG} as stable"
docker tag "${IMAGE}:${TAG}" "${IMAGE}:stable"

echo "Pushing image to GCR. Tagged as :stable"
echo "Pushing image to GAR. Tagged as :stable"
docker push "${IMAGE}:stable"

0 comments on commit 9de9c65

Please sign in to comment.