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

Fix canary build of the server image #3174

Merged
merged 2 commits into from
Jul 9, 2024
Merged
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
17 changes: 14 additions & 3 deletions magefile.go
Original file line number Diff line number Diff line change
Expand Up @@ -421,11 +421,22 @@ func pushImagesTo(registry string, info releases.GitMetadata) {
func PublishServerMultiArchImages() {
registry := getRegistry()
info := releases.LoadMetadata()
buildAndPushServerMultiArch(registry, info)

if info.IsTaggedRelease {
buildAndPushServerMultiArch(registry, info.Version)
} else {
fmt.Println("Skipping server image publish for not tagged release", info.Version)
}

if info.ShouldPublishPermalink() {
buildAndPushServerMultiArch(registry, info.Permalink)
} else {
fmt.Println("Skipping server image publish for permalink", info.Permalink)
}
}

func buildAndPushServerMultiArch(registry string, info releases.GitMetadata) {
img := fmt.Sprintf("%s/server:%s", registry, info.Version)
func buildAndPushServerMultiArch(registry string, tag string) {
img := fmt.Sprintf("%s/server:%s", registry, tag)
must.RunV("docker", "buildx", "create", "--use")
must.RunV("docker", "buildx", "bake", "-f", "docker-bake.json", "--push", "--set", "server.tags="+img, "server")
}
Expand Down
Loading