Sha256: b8565bfba40660718cce5a360b901c2e4caa4e34b0677e9249297fa9ded311d3

Contents?: true

Size: 816 Bytes

Versions: 9

Compression:

Stored size: 816 Bytes

Contents

require_relative "../base"

module Suspenders
  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

9 entries across 9 versions & 2 rubygems

Version Path
suspenders-1.53.0 lib/suspenders/generators/staging/pull_requests_generator.rb
welaika-suspenders-2.33 lib/suspenders/generators/staging/pull_requests_generator.rb
welaika-suspenders-2.32.2 lib/suspenders/generators/staging/pull_requests_generator.rb
welaika-suspenders-2.32.1 lib/suspenders/generators/staging/pull_requests_generator.rb
welaika-suspenders-2.32.0 lib/suspenders/generators/staging/pull_requests_generator.rb
suspenders-1.52.0 lib/suspenders/generators/staging/pull_requests_generator.rb
suspenders-1.51.0 lib/suspenders/generators/staging/pull_requests_generator.rb
welaika-suspenders-2.31.0 lib/suspenders/generators/staging/pull_requests_generator.rb
welaika-suspenders-2.30.0 lib/suspenders/generators/staging/pull_requests_generator.rb