diff --git a/.github/workflows/enterprise-release.yaml b/.github/workflows/enterprise-release.yaml index bc7cab9..e3ec764 100644 --- a/.github/workflows/enterprise-release.yaml +++ b/.github/workflows/enterprise-release.yaml @@ -79,15 +79,6 @@ jobs: make -j \ enterprise/build/exectrace_"$version"_linux_{amd64,arm64,armv7}.tag.pushed - # Tag as latest and push - for arch in amd64 arm64 armv7; do - versioned_tag=$(cat enterprise/build/exectrace_"$version"_linux_"$arch".tag) - latest_tag=$(./enterprise/scripts/image_tag.sh --arch "$arch" --version latest) - - docker tag "$versioned_tag" "$latest_tag" - docker push "$latest_tag" - done - - name: Build and push multi-arch Docker image if: ${{ !github.event.inputs.snapshot && !github.event.inputs.dry_run }} run: | @@ -95,11 +86,4 @@ jobs: version=$(./ci/scripts/version.sh) make -j \ - enterprise/build/exectrace_"$version"_linux.tag.pushed - - # Tag as latest and push - versioned_tag=$(cat enterprise/build/exectrace_"$version"_linux.tag) - latest_tag=$(./enterprise/scripts/image_tag.sh --version latest) - - docker tag "$versioned_tag" "$latest_tag" - docker push "$latest_tag" + enterprise/build/exectrace_{"$version",latest}_linux.tag.pushed diff --git a/Makefile.enterprise b/Makefile.enterprise index ca12693..04e3a4f 100644 --- a/Makefile.enterprise +++ b/Makefile.enterprise @@ -16,6 +16,9 @@ IMAGES_VERSIONLESS := $(foreach arch, $(ARCHES), $(ENTERPRISE_BUILD)/exectrace MAIN_IMAGE := $(ENTERPRISE_BUILD)/exectrace_$(VERSION)_linux.tag MAIN_IMAGE_PUSHED := $(MAIN_IMAGE).pushed +MAIN_IMAGE_LATEST := $(ENTERPRISE_BUILD)/exectrace_latest_linux.tag +MAIN_IMAGE_LATEST_PUSHED := $(MAIN_IMAGE_LATEST).pushed + .PHONY: clean-enterprise clean-enterprise: rm -rf "$(ENTERPRISE_BUILD)" @@ -85,8 +88,12 @@ $(IMAGES_PUSHED): $(ENTERPRISE_BUILD)/exectrace_$(VERSION)_linux_%.tag.pushed: $ # Creating a docker manifest requires the images to be pushed, so this job # depends on IMAGES_PUSHED instead of IMAGES. -$(MAIN_IMAGE): $(IMAGES_PUSHED) - image_tag="$$(./enterprise/scripts/image_tag.sh --version "$(VERSION)")" +$(MAIN_IMAGE) $(MAIN_IMAGE_LATEST): $(IMAGES_PUSHED) + version="$(VERSION)" + if [[ "$@" == "$(MAIN_IMAGE_LATEST)" ]]; then + version="latest" + fi + image_tag="$$(./enterprise/scripts/image_tag.sh --version "$${version}")" docker manifest create \ "$${image_tag}" \ $(foreach image, $(IMAGES), "$$(cat "$(image)")") @@ -96,3 +103,7 @@ $(MAIN_IMAGE): $(IMAGES_PUSHED) $(MAIN_IMAGE_PUSHED): $(MAIN_IMAGE) docker manifest push "$$(cat "$<")" cat "$<" > "$@" + +$(MAIN_IMAGE_LATEST_PUSHED): $(MAIN_IMAGE_LATEST) + docker manifest push "$$(cat "$<")" + cat "$<" > "$@"