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