Extract command #combine
This commit is contained in:
@@ -9,6 +9,12 @@ module Mrsk::Commands
|
|||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
def combine(*commands)
|
||||||
|
commands
|
||||||
|
.collect { |command| command + [ "&&" ] }.flatten # Join commands with &&
|
||||||
|
.tap { |commands| commands.pop } # Remove trailing &&
|
||||||
|
end
|
||||||
|
|
||||||
def docker(*args)
|
def docker(*args)
|
||||||
args.compact.unshift :docker
|
args.compact.unshift :docker
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -10,7 +10,9 @@ class Mrsk::Commands::Builder::Native < Mrsk::Commands::Base
|
|||||||
end
|
end
|
||||||
|
|
||||||
def push
|
def push
|
||||||
docker :build, "--push", "-t", config.absolute_image, "."
|
combine \
|
||||||
|
docker(:build, "-t", config.absolute_image, "."),
|
||||||
|
docker(:push, config.absolute_image)
|
||||||
end
|
end
|
||||||
|
|
||||||
def pull
|
def pull
|
||||||
|
|||||||
Reference in New Issue
Block a user