Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/perron/install.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
copy_file "#{__dir__}/install/README.md", "app/content/data/README.md"

say "Create deploy configuration"
copy_file "#{__dir__}/install/deploy.yml", "config/deploy.yml"
copy_file "#{__dir__}/install/deploy.yml.erb", "config/deploy.yml.erb"

say "Add Markdown gem options to Gemfile"
append_to_file "Gemfile", <<~RUBY
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
# Deploy configuration for Perron
# Requires Beam Up (`bundle add beam_up`)
# See also: https://perron.railsdesigner.com/docs/deploy/
# See also: https://perron.railsdesigner.com/docs/deploy/#deploy-task

# Uncomment and configure your provider:
# provider: netlify
# provider: seal_static

# netlify:
# api_token: your_token_here
# site_id: your_site_id
# seal_static:
# api_key: your_key_here

before_actions:
- RAILS_ENV=production bundle exec rails perron:build
Expand Down
23 changes: 15 additions & 8 deletions lib/perron/tasks/deploy.rake
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,19 @@ namespace :perron do
MSG
end

config = Rails.root.join("config/deploy.yml")
config_file = "config/deploy.yml" if Rails.root.join("config/deploy.yml").exist?
config_file = "config/deploy.yml.erb" if Rails.root.join("config/deploy.yml.erb").exist?

unless config.exist?
template = File.expand_path("../install/deploy.yml", __dir__)
FileUtils.cp(template, config)

puts "Created config/deploy.yml"
if config_file.nil?
FileUtils.cp(File.expand_path("../install/deploy.yml.erb", __dir__), Rails.root.join("config/deploy.yml.erb"))
config_file = "config/deploy.yml.erb"
puts "Created config/deploy.yml.erb"
end

beamed = BeamUp.with_progress do
BeamUp.deploy!(
Perron.configuration.output,
config_file: "config/deploy.yml"
config_file: config_file
)
end

Expand All @@ -50,7 +50,14 @@ namespace :perron do
MSG
end

path = BeamUp.init!(arguments[:provider], config_file: "config/deploy.yml")
config_file = "config/deploy.yml" if Rails.root.join("config/deploy.yml").exist?
config_file = "config/deploy.yml.erb" if Rails.root.join("config/deploy.yml.erb").exist?

if config_file.nil?
config_file = "config/deploy.yml.erb"
end

path = BeamUp.init!(arguments[:provider], config_file: config_file)

puts "Configured Beam Up in #{path}"
end
Expand Down
Loading