Bootstrap entirely clean new server

This commit is contained in:
David Heinemeier Hansson
2023-01-08 10:07:08 +01:00
parent 4cbc4aa9b7
commit 7f220ea987
2 changed files with 16 additions and 0 deletions

View File

@@ -1,4 +1,7 @@
namespace :mrsk do
desc "Deploy app for the first time to a fresh server"
task fresh: [ "server:bootstrap", "registry:login", "app:deliver", "traefik:start", "app:start" ]
desc "Push the latest version of the app, ensure Traefik is running, then restart app"
task deploy: [ "registry:login", "app:push", "traefik:start", "app:restart" ]

View File

@@ -0,0 +1,13 @@
require_relative "setup"
app = Mrsk::Commands::App.new(MRSK_CONFIG)
namespace :mrsk do
namespace :server do
desc "Setup Docker on the remote servers"
task :bootstrap do
# FIXME: Detect when apt-get is not available and use the appropriate alternative
on(MRSK_CONFIG.servers) { execute "apt-get install docker.io -y" }
end
end
end