Include version in absolute image
This commit is contained in:
@@ -25,7 +25,7 @@ class Mrsk::Configuration
|
||||
end
|
||||
|
||||
def absolute_image
|
||||
[ config.registry["server"], image ].compact.join("/")
|
||||
[ config.registry["server"], image_with_version ].compact.join("/")
|
||||
end
|
||||
|
||||
def image_with_version
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
require "test_helper"
|
||||
require "mrsk/configuration"
|
||||
|
||||
ENV["VERSION"] = "123"
|
||||
|
||||
class ConfigurationTest < ActiveSupport::TestCase
|
||||
setup do
|
||||
@config = { service: "app", image: "dhh/app", registry: { "username" => "dhh", "password" => "secret" } }
|
||||
@@ -8,9 +10,9 @@ class ConfigurationTest < ActiveSupport::TestCase
|
||||
|
||||
test "absolute image" do
|
||||
configuration = Mrsk::Configuration.new(@config)
|
||||
assert_equal "dhh/app", configuration.absolute_image
|
||||
assert_equal "dhh/app:123", configuration.absolute_image
|
||||
|
||||
configuration = Mrsk::Configuration.new(@config.tap { |c| c[:registry].merge!({ "server" => "ghcr.io" }) })
|
||||
assert_equal "ghcr.io/dhh/app", configuration.absolute_image
|
||||
assert_equal "ghcr.io/dhh/app:123", configuration.absolute_image
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user