Sha256: af60e35d613e471dac49dd301eb3af1e0082d7f49a14efff335109c04415f68d
Contents?: true
Size: 1.83 KB
Versions: 3
Compression:
Stored size: 1.83 KB
Contents
class CreateHerokuApp ADMIN_EMAIL = 'operations@renuo.ch'.freeze def initialize; end def run(args) project_name = args[0] abort('>> Project name must be between 2 and 22 characters.') unless project_name&.length&.between?(2, 22) emails = FetchEmails.new.fetch_emails say "# Commands to setup your Heroku application\n".colorize :green ENVIRONMENTS.each do |env| print_environment_commands(emails, env, project_name) end print_pipelines_commands(project_name) end private def print_environment_commands(emails, env, project_name) heroku_name = "#{project_name}-#{env}" say "heroku apps:create --region eu #{heroku_name}" say "heroku domains:add #{heroku_name}.renuoapp.ch --app #{heroku_name}" say "heroku domains:add #{project_name}-#{MASTER}.renuoapp.ch --app #{heroku_name}" if env == MAIN say "heroku addons:create heroku-postgresql --app #{heroku_name}" say "heroku addons:create papertrail --app #{heroku_name}" say "heroku labs:enable runtime-dyno-metadata --app #{heroku_name}" say "heroku pg:backups:schedule DATABASE_URL --at '02:00 Europe/Zurich' --app #{heroku_name}" print_ownership_commands(emails, heroku_name) end def print_pipelines_commands(project_name) say "heroku pipelines:create #{project_name} --app #{project_name}-#{MAIN} -s production" say "heroku pipelines:add #{project_name} --app #{project_name}-#{DEVELOP} -s staging" say "heroku pipelines:add #{project_name} --app #{project_name}-#{TESTING} -s staging" say "\n" end def print_ownership_commands(emails, heroku_name) say "\n" emails.each do |email| say "heroku access:add #{email} --app #{heroku_name}" end say "heroku access:add #{ADMIN_EMAIL} --app #{heroku_name}" say "heroku apps:transfer -a #{heroku_name} #{ADMIN_EMAIL}" say "\n" end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
renuo-cli-3.1.5 | lib/renuo/cli/app/create_heroku_app.rb |
renuo-cli-3.1.4 | lib/renuo/cli/app/create_heroku_app.rb |
renuo-cli-3.1.3 | lib/renuo/cli/app/create_heroku_app.rb |