class Suspenders::Staging::PullRequestsGenerator

Public Instance Methods

configure_heroku_staging_pr_pipeline_host() click to toggle source
# File lib/suspenders/generators/staging/pull_requests_generator.rb, line 6
      def configure_heroku_staging_pr_pipeline_host
        config = <<-RUBY

  if ENV.fetch('HEROKU_APP_NAME', '').include?('staging-pr-')
    ENV['APPLICATION_HOST'] = ENV['HEROKU_APP_NAME'] + '.herokuapp.com'
    ENV['ASSET_HOST'] = ENV['HEROKU_APP_NAME'] + '.herokuapp.com'
  end
        RUBY

        inject_into_file(
          "config/environments/production.rb",
          config,
          after: "Rails.application.configure do\n",
        )
      end
create_review_apps_setup_script() click to toggle source
# File lib/suspenders/generators/staging/pull_requests_generator.rb, line 22
def create_review_apps_setup_script
  template(
    "bin_setup_review_app.erb",
    "bin/setup_review_app",
    force: true,
  )

  run "chmod a+x bin/setup_review_app"
end