Skip to content

Commit

Permalink
fix: improve dev-tools release process (#2687)
Browse files Browse the repository at this point in the history
  • Loading branch information
apeabody authored Nov 12, 2024
1 parent c46b613 commit 6a20dfb
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 5 deletions.
20 changes: 16 additions & 4 deletions .github/workflows/build-push-cft-devtools.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ jobs:
workload_identity_provider: '${{ secrets.GCP_WIF_PROVIDER }}'
service_account: '${{ secrets.GCP_WIF_SA_EMAIL }}'

- uses: google-github-actions/setup-gcloud@6189d56e4096ee891640bb02ac264be376592d6a # v2.1.2
- name: Setup gcloud
uses: google-github-actions/setup-gcloud@6189d56e4096ee891640bb02ac264be376592d6a # v2.1.2
with:
project_id: ${{ env.PROJECT_ID }}

Expand All @@ -38,12 +39,23 @@ jobs:
gcloud auth configure-docker -q
cd infra/build && make build-image-developer-tools
- name: Push
- name: Filter paths for push
uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
id: filter
with:
filters: |
src:
- "infra/build/**"
- if: steps.filter.outputs.src == 'true'
name: Push
env:
GITHUB_SHA: ${{ github.sha }}
run: |-
cd infra/build && make release-image-developer-tools
- name: Open issue if failed
if: ${{ failure() }}
- name: Open issue if push failed
if: ${{ failure() && steps.filter.outputs.src == 'true' }}
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
with:
script: |-
Expand Down
23 changes: 22 additions & 1 deletion infra/build/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2019-2023 Google LLC
# Copyright 2019-2024 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -115,6 +115,11 @@ build-image-developer-tools:

.PHONY: release-image-developer-tools
release-image-developer-tools:
if [[ -z "${GITHUB_SHA}" ]]; then
echo "ERROR: Missing GITHUB_SHA for the release"
exit 1
fi

docker tag ${DOCKER_IMAGE_DEVELOPER_TOOLS}:${DOCKER_TAG_VERSION_DEVELOPER_TOOLS} \
${REGISTRY_URL}/${DOCKER_IMAGE_DEVELOPER_TOOLS}:${DOCKER_TAG_VERSION_DEVELOPER_TOOLS}
docker push ${REGISTRY_URL}/${DOCKER_IMAGE_DEVELOPER_TOOLS}:${DOCKER_TAG_VERSION_DEVELOPER_TOOLS}
Expand All @@ -139,6 +144,10 @@ release-image-developer-tools:
${REGISTRY_URL}/${DOCKER_IMAGE_DEVELOPER_TOOLS}:${DEP_TAG_PREFIX}${DOCKER_TAG_MINOR_VERSION_DEVELOPER_TOOLS}
docker push ${REGISTRY_URL}/${DOCKER_IMAGE_DEVELOPER_TOOLS}:${DEP_TAG_PREFIX}${DOCKER_TAG_MINOR_VERSION_DEVELOPER_TOOLS}

docker tag ${DOCKER_IMAGE_DEVELOPER_TOOLS}:${DOCKER_TAG_VERSION_DEVELOPER_TOOLS} \
${REGISTRY_URL}/${DOCKER_IMAGE_DEVELOPER_TOOLS}:${DEP_TAG_PREFIX}${GITHUB_SHA}
docker push ${REGISTRY_URL}/${DOCKER_IMAGE_DEVELOPER_TOOLS}:${DEP_TAG_PREFIX}${GITHUB_SHA}

docker tag ${DOCKER_IMAGE_DEVELOPER_TOOLS_JENKINS}:${DOCKER_TAG_VERSION_DEVELOPER_TOOLS} \
${REGISTRY_URL}/${DOCKER_IMAGE_DEVELOPER_TOOLS_JENKINS}:${DOCKER_TAG_VERSION_DEVELOPER_TOOLS}
docker push ${REGISTRY_URL}/${DOCKER_IMAGE_DEVELOPER_TOOLS_JENKINS}:${DOCKER_TAG_VERSION_DEVELOPER_TOOLS}
Expand All @@ -163,6 +172,10 @@ release-image-developer-tools:
${REGISTRY_URL}/${DOCKER_IMAGE_DEVELOPER_TOOLS_JENKINS}:${DEP_TAG_PREFIX}${DOCKER_TAG_MINOR_VERSION_DEVELOPER_TOOLS}
docker push ${REGISTRY_URL}/${DOCKER_IMAGE_DEVELOPER_TOOLS_JENKINS}:${DEP_TAG_PREFIX}${DOCKER_TAG_MINOR_VERSION_DEVELOPER_TOOLS}

docker tag ${DOCKER_IMAGE_DEVELOPER_TOOLS_JENKINS}:${DOCKER_TAG_VERSION_DEVELOPER_TOOLS} \
${REGISTRY_URL}/${DOCKER_IMAGE_DEVELOPER_TOOLS_JENKINS}:${DEP_TAG_PREFIX}${GITHUB_SHA}
docker push ${REGISTRY_URL}/${DOCKER_IMAGE_DEVELOPER_TOOLS_JENKINS}:${DEP_TAG_PREFIX}${GITHUB_SHA}

docker tag ${DOCKER_IMAGE_DEVELOPER_LIGHT}:${DOCKER_TAG_VERSION_DEVELOPER_TOOLS} \
${REGISTRY_URL}/${DOCKER_IMAGE_DEVELOPER_LIGHT}:${DOCKER_TAG_VERSION_DEVELOPER_TOOLS}
docker push ${REGISTRY_URL}/${DOCKER_IMAGE_DEVELOPER_LIGHT}:${DOCKER_TAG_VERSION_DEVELOPER_TOOLS}
Expand All @@ -187,6 +200,10 @@ release-image-developer-tools:
${REGISTRY_URL}/${DOCKER_IMAGE_DEVELOPER_LIGHT}:${DEP_TAG_PREFIX}${DOCKER_TAG_MINOR_VERSION_DEVELOPER_TOOLS}
docker push ${REGISTRY_URL}/${DOCKER_IMAGE_DEVELOPER_LIGHT}:${DEP_TAG_PREFIX}${DOCKER_TAG_MINOR_VERSION_DEVELOPER_TOOLS}

docker tag ${DOCKER_IMAGE_DEVELOPER_LIGHT}:${DOCKER_TAG_VERSION_DEVELOPER_TOOLS} \
${REGISTRY_URL}/${DOCKER_IMAGE_DEVELOPER_LIGHT}:${DEP_TAG_PREFIX}${GITHUB_SHA}
docker push ${REGISTRY_URL}/${DOCKER_IMAGE_DEVELOPER_LIGHT}:${DEP_TAG_PREFIX}${GITHUB_SHA}

docker tag ${DOCKER_IMAGE_DEVELOPER_KRM}:${DOCKER_TAG_VERSION_DEVELOPER_TOOLS} \
${REGISTRY_URL}/${DOCKER_IMAGE_DEVELOPER_KRM}:${DOCKER_TAG_VERSION_DEVELOPER_TOOLS}
docker push ${REGISTRY_URL}/${DOCKER_IMAGE_DEVELOPER_KRM}:${DOCKER_TAG_VERSION_DEVELOPER_TOOLS}
Expand All @@ -211,6 +228,10 @@ release-image-developer-tools:
${REGISTRY_URL}/${DOCKER_IMAGE_DEVELOPER_KRM}:${DEP_TAG_PREFIX}${DOCKER_TAG_MINOR_VERSION_DEVELOPER_TOOLS}
docker push ${REGISTRY_URL}/${DOCKER_IMAGE_DEVELOPER_KRM}:${DEP_TAG_PREFIX}${DOCKER_TAG_MINOR_VERSION_DEVELOPER_TOOLS}

docker tag ${DOCKER_IMAGE_DEVELOPER_KRM}:${DOCKER_TAG_VERSION_DEVELOPER_TOOLS} \
${REGISTRY_URL}/${DOCKER_IMAGE_DEVELOPER_KRM}:${DEP_TAG_PREFIX}${GITHUB_SHA}
docker push ${REGISTRY_URL}/${DOCKER_IMAGE_DEVELOPER_KRM}:${DEP_TAG_PREFIX}${GITHUB_SHA}

# The following tasks are provided as examples and aren't invoked from this
# repository directly. These three make targets are the only targets that
# should be included in every CFT module's `Makefile`
Expand Down

0 comments on commit 6a20dfb

Please sign in to comment.