Clean things up via Rubocop

This commit is contained in:
Nick Hammond
2024-08-27 22:52:06 -07:00
parent 897b3b4e46
commit 826308aabd
3 changed files with 7 additions and 7 deletions

View File

@@ -9,7 +9,7 @@ class Kamal::Commands::Builder::Native::Pack < Kamal::Commands::Builder::Native
"-t", config.absolute_image, "-t", config.absolute_image,
"-t", config.latest_image, "-t", config.latest_image,
"--env", "BP_IMAGE_LABELS=service=#{config.service}", "--env", "BP_IMAGE_LABELS=service=#{config.service}",
secrets.map { |secret| ["--env", Kamal::Utils.sensitive(ENV[secret])] }, secrets.map { |secret| [ "--env", Kamal::Utils.sensitive(ENV[secret]) ] },
"--path", build_context), "--path", build_context),
docker(:push, config.absolute_image), docker(:push, config.absolute_image),
docker(:push, config.latest_image) docker(:push, config.latest_image)
@@ -21,6 +21,6 @@ class Kamal::Commands::Builder::Native::Pack < Kamal::Commands::Builder::Native
end end
def buildpacks def buildpacks
(pack_buildpacks << "paketo-buildpacks/image-labels").map { |buildpack| ["--buildpack", buildpack] } (pack_buildpacks << "paketo-buildpacks/image-labels").map { |buildpack| [ "--buildpack", buildpack ] }
end end
end end

View File

@@ -54,7 +54,7 @@ class CommandsBuilderTest < ActiveSupport::TestCase
end end
test "target pack when pack is set" do 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" ] }}) 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 "native/pack", builder.name
assert_equal \ 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", "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",

View File

@@ -33,21 +33,21 @@ class ConfigurationBuilderTest < ActiveSupport::TestCase
end end
test "pack?" do test "pack?" do
refute config.builder.pack? assert_not config.builder.pack?
end end
test "pack? with pack builder" do test "pack? with pack builder" do
@deploy[:builder] = { "pack" => {"builder" => "heroku/builder:24"} } @deploy[:builder] = { "pack" => { "builder" => "heroku/builder:24" } }
assert config.builder.pack? assert config.builder.pack?
end end
test "pack details" do test "pack details" do
@deploy[:builder] = { "pack" => {"arch" => "amd64", "builder" => "heroku/builder:24", "buildpacks" => ["heroku/ruby", "heroku/procfile"]} } @deploy[:builder] = { "pack" => { "arch" => "amd64", "builder" => "heroku/builder:24", "buildpacks" => [ "heroku/ruby", "heroku/procfile" ] } }
assert_equal "amd64", config.builder.pack_arch assert_equal "amd64", config.builder.pack_arch
assert_equal "heroku/builder:24", config.builder.pack_builder assert_equal "heroku/builder:24", config.builder.pack_builder
assert_equal ["heroku/ruby", "heroku/procfile"], config.builder.pack_buildpacks assert_equal [ "heroku/ruby", "heroku/procfile" ], config.builder.pack_buildpacks
end end
test "remote_arch" do test "remote_arch" do