Merge branch 'main' into cleanup-excessive-containers-running

* main: (24 commits)
  Bump version for 0.11.0
  Labels can be added to Traefik
  Make rollbacks role-aware
  fix typo role to roles
  Explained the latest modifications of Traefik container labels
  Remove .idea folder
  Updated README.md with new healthcheck.max_attempts option
  Fix test case: console output message was not updated to display the current/total attempts
  Require net-ssh ~> 7.0 for SHA-2 support
  Improved deploy lock acquisition
  Excess CR
  Style
  Simpler
  Make it explicit, focus on Ubuntu
  More explicit
  Not that --bundle is a Rails 7+ option
  Update README.md
  Update README.md
  Improved: configurable max_attempts for healthcheck
  Traefik service name to be derived from role and destination
  ...
This commit is contained in:
Jacopo
2023-04-12 11:52:47 +02:00
21 changed files with 239 additions and 79 deletions

View File

@@ -1,7 +1,7 @@
class Mrsk::Commands::Traefik < Mrsk::Commands::Base
delegate :optionize, to: Mrsk::Utils
delegate :argumentize, :optionize, to: Mrsk::Utils
IMAGE = "traefik:v2.9.9"
DEFAULT_IMAGE = "traefik:v2.9"
CONTAINER_PORT = 80
def run
@@ -11,8 +11,9 @@ class Mrsk::Commands::Traefik < Mrsk::Commands::Base
"--publish", port,
"--volume", "/var/run/docker.sock:/var/run/docker.sock",
*config.logging_args,
*label_args,
*docker_options_args,
IMAGE,
image,
"--providers.docker",
"--log.level=DEBUG",
*cmd_option_args
@@ -56,6 +57,18 @@ class Mrsk::Commands::Traefik < Mrsk::Commands::Base
end
private
def label_args
argumentize "--label", labels
end
def labels
config.traefik["labels"] || []
end
def image
config.traefik.fetch("image") { DEFAULT_IMAGE }
end
def docker_options_args
optionize(config.traefik["options"] || {})
end