This commit is contained in:
David Heinemeier Hansson
2023-05-02 13:35:05 +02:00
parent cbda851436
commit f719540e0c

View File

@@ -12,18 +12,18 @@ class Mrsk::Cli::Build < Mrsk::Cli::Base
desc "push", "Build and push app image to registry" desc "push", "Build and push app image to registry"
def push def push
with_lock do with_lock do
cli_build = self cli = self
run_locally do run_locally do
begin begin
if cli_build.dependencies if cli.dependencies
MRSK.with_verbosity(:debug) { execute *MRSK.builder.push } MRSK.with_verbosity(:debug) { execute *MRSK.builder.push }
end end
rescue SSHKit::Command::Failed => e rescue SSHKit::Command::Failed => e
if e.message =~ /(no builder)|(no such file or directory)/ if e.message =~ /(no builder)|(no such file or directory)/
error "Missing compatible builder, so creating a new one first" error "Missing compatible builder, so creating a new one first"
if cli_build.create if cli.create
MRSK.with_verbosity(:debug) { execute *MRSK.builder.push } MRSK.with_verbosity(:debug) { execute *MRSK.builder.push }
end end
else else
@@ -94,6 +94,7 @@ class Mrsk::Cli::Build < Mrsk::Cli::Base
raise BuildError, build_error raise BuildError, build_error
end end
end end
true true
end end
end end