Add a pack option to the builder options
This commit is contained in:
@@ -53,6 +53,14 @@ class CommandsBuilderTest < ActiveSupport::TestCase
|
||||
builder.push.join(" ")
|
||||
end
|
||||
|
||||
test "target pack when pack is set" do
|
||||
builder = new_builder_command(builder: { "pack" => { "arch" => "amd64" , "builder" => "heroku/builder:24", "buildpacks" => [ "heroku/ruby", "heroku/procfile" ] }})
|
||||
assert_equal "native/pack", builder.name
|
||||
assert_equal \
|
||||
"pack build dhh/app:123 --platform linux/amd64 --builder heroku/builder:24 --buildpack heroku/ruby --buildpack heroku/procfile --buildpack paketo-buildpacks/image-labels -t dhh/app:123 -t dhh/app:latest --env BP_IMAGE_LABELS=service=app --path . && docker push dhh/app:123 && docker push dhh/app:latest",
|
||||
builder.push.join(" ")
|
||||
end
|
||||
|
||||
test "build args" do
|
||||
builder = new_builder_command(builder: { "args" => { "a" => 1, "b" => 2 } })
|
||||
assert_equal \
|
||||
|
||||
@@ -32,6 +32,24 @@ class ConfigurationBuilderTest < ActiveSupport::TestCase
|
||||
assert_equal false, config.builder.remote?
|
||||
end
|
||||
|
||||
test "pack?" do
|
||||
refute config.builder.pack?
|
||||
end
|
||||
|
||||
test "pack? with pack builder" do
|
||||
@deploy[:builder] = { "pack" => {"builder" => "heroku/builder:24"} }
|
||||
|
||||
assert config.builder.pack?
|
||||
end
|
||||
|
||||
test "pack details" do
|
||||
@deploy[:builder] = { "pack" => {"arch" => "amd64", "builder" => "heroku/builder:24", "buildpacks" => ["heroku/ruby", "heroku/procfile"]} }
|
||||
|
||||
assert_equal "amd64", config.builder.pack_arch
|
||||
assert_equal "heroku/builder:24", config.builder.pack_builder
|
||||
assert_equal ["heroku/ruby", "heroku/procfile"], config.builder.pack_buildpacks
|
||||
end
|
||||
|
||||
test "remote_arch" do
|
||||
assert_nil config.builder.remote_arch
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user