Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the multiarch disabled + remote set #830

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions lib/kamal/commands/builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ def name

def target
case
when !config.builder.multiarch? && !config.builder.cached?
when !config.builder.multiarch? && !config.builder.cached? && !config.builder.remote?
native
when !config.builder.multiarch? && config.builder.cached?
when !config.builder.multiarch? && config.builder.cached? && !config.builder.remote?
native_cached
when config.builder.local? && config.builder.remote?
when config.builder.multiarch? && config.builder.local? && config.builder.remote?
multiarch_remote
when config.builder.remote?
native_remote
Expand Down
8 changes: 8 additions & 0 deletions test/commands/builder_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,14 @@ class CommandsBuilderTest < ActiveSupport::TestCase
builder.push.join(" ")
end

test "target native remote when multiarch is disabled and remote is set" do
builder = new_builder_command(builder: { "multiarch" => false, "remote" => { "arch" => "amd64" } })
assert_equal "native/remote", builder.name
assert_equal \
"docker buildx build --push --platform linux/amd64 --builder kamal-app-native-remote -t dhh/app:123 -t dhh/app:latest --label service=\"app\" --file Dockerfile .",
builder.push.join(" ")
end

test "build args" do
builder = new_builder_command(builder: { "args" => { "a" => 1, "b" => 2 } })
assert_equal \
Expand Down