Sha256: eedd68b3694d01f0607b6e079b947238f7ac0e3e470eabb59c60b751abd422b5

Contents?: true

Size: 815 Bytes

Versions: 4

Compression:

Stored size: 815 Bytes

Contents

require_relative "../base"

module Bulldozer
  module Staging
    class PullRequestsGenerator < Generators::Base
      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

      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
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
bulldozer-1.6.3 lib/bulldozer/generators/staging/pull_requests_generator.rb
bulldozer-1.6.2 lib/bulldozer/generators/staging/pull_requests_generator.rb
bulldozer-1.6.1 lib/bulldozer/generators/staging/pull_requests_generator.rb
bulldozer-1.6.0 lib/bulldozer/generators/staging/pull_requests_generator.rb