Enable docker secrets in the builder as a more secure alternative to build args.
This commit is contained in:
@@ -27,6 +27,11 @@ class CommandsBuilderTest < ActiveSupport::TestCase
|
||||
assert_equal [ "--build-arg", "a=1", "--build-arg", "b=2" ], builder.target.build_args
|
||||
end
|
||||
|
||||
test "build secrets" do
|
||||
builder = Mrsk::Commands::Builder.new(Mrsk::Configuration.new(@config.merge({ builder: { "secrets" => ["token_a", "token_b"] } })))
|
||||
assert_equal [ "--secret", "id=token_a", "--secret", "id=token_b" ], builder.target.build_secrets
|
||||
end
|
||||
|
||||
test "native push with build args" do
|
||||
builder = Mrsk::Commands::Builder.new(Mrsk::Configuration.new(@config.merge({ builder: { "multiarch" => false, "args" => { "a" => 1, "b" => 2 } } })))
|
||||
assert_equal [ :docker, :build, "-t", "--build-arg", "a=1", "--build-arg", "b=2", "dhh/app:123", ".", "&&", :docker, :push, "dhh/app:123" ], builder.push
|
||||
|
||||
Reference in New Issue
Block a user