Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check if docker images and helm charts exist before creating them #3825

Merged
merged 2 commits into from
Sep 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changesets/maint_garypen_3663_no_overwrites.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
### Check if docker images and helm charts exist before creating them ([Issue #3663](https://github.com/apollographql/router/issues/3663))

This improves the resilience of our pipeline.

By [@garypen](https://github.com/garypen) in https://github.com/apollographql/router/pull/3825
8 changes: 8 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -761,6 +761,10 @@ jobs:
docker buildx inspect --bootstrap
# Note: GH Token owned by apollo-bot2, no expire
echo ${GITHUB_OCI_TOKEN} | docker login ghcr.io -u apollo-bot2 --password-stdin
# To prevent overwrite, check to see if our images already exists
# If the manifest command succeeds, the images already exist
docker manifest inspect ${ROUTER_TAG}:${VERSION} > /dev/null && exit 1
docker manifest inspect ${ROUTER_TAG}:${VERSION}-debug > /dev/null && exit 1
# Build and push debug image
docker buildx build --platform linux/amd64,linux/arm64 --push --build-arg DEBUG_IMAGE="true" --build-arg ROUTER_RELEASE=${VERSION} -f dockerfiles/Dockerfile.router -t ${ROUTER_TAG}:${VERSION}-debug .
# Build and push release image
Expand All @@ -776,6 +780,10 @@ jobs:
CHART=$(ls -t router*.tgz| head -1)
# Note: GH Token owned by apollo-bot2, no expire
echo ${GITHUB_OCI_TOKEN} | helm registry login -u apollo-bot2 --password-stdin ghcr.io
# To prevent overwrite, check to see if our chart already exists
# If the show all command succeeds, the chart already exists
VERSION=$(basename ${CHART} .tgz)
helm show all oci://ghcr.io/apollographql/helm-charts/router --version ${VERSION} > /dev/null && exit 1
# Push chart to repository
helm push ${CHART} oci://ghcr.io/apollographql/helm-charts

Expand Down