Make init more resilient and communicative
This commit is contained in:
@@ -15,11 +15,15 @@ namespace :mrsk do
|
|||||||
|
|
||||||
desc "Create config stub in config/deploy.yml"
|
desc "Create config stub in config/deploy.yml"
|
||||||
task :init do
|
task :init do
|
||||||
require "fileutils"
|
if (deploy_file = Rails.root.join("config/deploy.yml")).exist?
|
||||||
FileUtils.cp_r \
|
puts "Config file already exists in config/deploy.yml (remove first to create a new one)"
|
||||||
Pathname.new(File.expand_path("templates/deploy.yml", __dir__)),
|
else
|
||||||
Rails.root.join("config/deploy.yml")
|
require "fileutils"
|
||||||
info "Created configuration file in config/deploy.yml"
|
FileUtils.cp_r Pathname.new(File.expand_path("templates/deploy.yml", __dir__)), deploy_file
|
||||||
|
|
||||||
|
puts "Created configuration file in config/deploy.yml"
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
desc "Remove Traefik, app, and registry session from servers"
|
desc "Remove Traefik, app, and registry session from servers"
|
||||||
|
|||||||
Reference in New Issue
Block a user