Chain builder setup for better resiliency
Context may already exist while buildx does not
This commit is contained in:
@@ -16,6 +16,10 @@ module Mrsk::Commands
|
|||||||
.tap { |commands| commands.pop } # Remove trailing combiner
|
.tap { |commands| commands.pop } # Remove trailing combiner
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def chain(*commands)
|
||||||
|
combine *commands, by: ";"
|
||||||
|
end
|
||||||
|
|
||||||
def pipe(*commands)
|
def pipe(*commands)
|
||||||
combine *commands, by: "|"
|
combine *commands, by: "|"
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -2,13 +2,13 @@ require "mrsk/commands/builder/native"
|
|||||||
|
|
||||||
class Mrsk::Commands::Builder::Native::Remote < Mrsk::Commands::Builder::Native
|
class Mrsk::Commands::Builder::Native::Remote < Mrsk::Commands::Builder::Native
|
||||||
def create
|
def create
|
||||||
combine \
|
chain \
|
||||||
create_context,
|
create_context,
|
||||||
create_buildx
|
create_buildx
|
||||||
end
|
end
|
||||||
|
|
||||||
def remove
|
def remove
|
||||||
combine \
|
chain \
|
||||||
remove_context,
|
remove_context,
|
||||||
remove_buildx
|
remove_buildx
|
||||||
end
|
end
|
||||||
@@ -25,7 +25,7 @@ class Mrsk::Commands::Builder::Native::Remote < Mrsk::Commands::Builder::Native
|
|||||||
end
|
end
|
||||||
|
|
||||||
def info
|
def info
|
||||||
combine \
|
chain \
|
||||||
docker(:context, :ls),
|
docker(:context, :ls),
|
||||||
docker(:buildx, :ls)
|
docker(:buildx, :ls)
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user