Chain builder setup for better resiliency

Context may already exist while buildx does not
This commit is contained in:
David Heinemeier Hansson
2023-01-27 15:41:28 +01:00
parent a5ebb30de2
commit 03fdb9a9ac
2 changed files with 7 additions and 3 deletions

View File

@@ -16,6 +16,10 @@ module Mrsk::Commands
.tap { |commands| commands.pop } # Remove trailing combiner
end
def chain(*commands)
combine *commands, by: ";"
end
def pipe(*commands)
combine *commands, by: "|"
end

View File

@@ -2,13 +2,13 @@ require "mrsk/commands/builder/native"
class Mrsk::Commands::Builder::Native::Remote < Mrsk::Commands::Builder::Native
def create
combine \
chain \
create_context,
create_buildx
end
def remove
combine \
chain \
remove_context,
remove_buildx
end
@@ -25,7 +25,7 @@ class Mrsk::Commands::Builder::Native::Remote < Mrsk::Commands::Builder::Native
end
def info
combine \
chain \
docker(:context, :ls),
docker(:buildx, :ls)
end