Use Base class for default config assignment
This commit is contained in:
@@ -1,4 +1,11 @@
|
||||
module Mrsk::Commands
|
||||
class Base
|
||||
attr_accessor :config
|
||||
|
||||
def initialize(config)
|
||||
@config = config
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
require "mrsk/commands/app"
|
||||
|
||||
@@ -1,10 +1,4 @@
|
||||
class Mrsk::Commands::App
|
||||
attr_accessor :config
|
||||
|
||||
def initialize(config)
|
||||
@config = config
|
||||
end
|
||||
|
||||
class Mrsk::Commands::App < Mrsk::Commands::Base
|
||||
def push
|
||||
# TODO: Run 'docker buildx create --use' when needed
|
||||
"docker buildx build --push --platform=linux/amd64,linux/arm64 -t #{config.image_with_version} ."
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class Mrsk::Commands::Registry
|
||||
class Mrsk::Commands::Registry < Mrsk::Commands::Base
|
||||
def login
|
||||
if (user = ENV["DOCKER_USER"]).present? && (password = ENV["DOCKER_PASSWORD"]).present?
|
||||
# FIXME: Find a way to hide PW so it's not shown on terminal
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class Mrsk::Commands::Traefik
|
||||
class Mrsk::Commands::Traefik < Mrsk::Commands::Base
|
||||
def start
|
||||
"docker run --name traefik " +
|
||||
"--rm -d " +
|
||||
|
||||
Reference in New Issue
Block a user