Check the registry login before releasing

The GitHub release was created before the image push failed on a missing
docker login, leaving the release half done.
This commit is contained in:
Stanko K.R.
2026-09-26 11:16:03 +02:00
parent 87ba7aa3cc
commit e5cfffda67
+14 -1
View File
@@ -18,7 +18,8 @@ GIT_SHA = `git rev-parse HEAD`.strip
MANUAL_NOTES = ARGV.delete("--notes")
VERSION = ARGV[0]
DOCKER_IMAGE_NAME = "registry.once.com/campfire"
DOCKER_REGISTRY = "registry.once.com"
DOCKER_IMAGE_NAME = "#{DOCKER_REGISTRY}/campfire"
DOCKER_LATEST_IMAGE_NAME = [ DOCKER_IMAGE_NAME, :latest ].join(":")
DOCKER_TAGGED_IMAGE_NAME = [ DOCKER_IMAGE_NAME, GIT_SHA ].join(":")
@@ -47,6 +48,18 @@ def announcing(message)
yield
end
announcing "Checking #{DOCKER_REGISTRY} login..." do
unless system "docker", "manifest", "inspect", DOCKER_LATEST_IMAGE_NAME, out: File::NULL, err: File::NULL
abort <<~MESSAGE
Not logged in to #{DOCKER_REGISTRY}. Run:
docker login #{DOCKER_REGISTRY}
The credentials are in the "chatinabox" entry in 1Password.
MESSAGE
end
end
on(:local) do
builder_found = test :docker, :buildx, :inspect, BUILDER_NAME