Sha256: 7d58775d840627c578b33ebc87158c5d20e2b90ad0819e948a72925ba92bdab6

Contents?: true

Size: 1.79 KB

Versions: 3

Compression:

Stored size: 1.79 KB

Contents

say "Configuring Heroku application...".magenta

if would_you_like? "Create Heroku apps?".red
  config = {}
  heroku_name = ask_unless_test "What do you want to call your app? (#{heroku_name})".red
  heroku_name = @app_name.gsub('_','')
  config['staging'] = would_you_like? "Create staging app? (#{heroku_name}-staging.heroku.com) [y,n]".red
  config['deploy']  = would_you_like? "Deploy immediately?".red
  config['domain']  = ask_unless_test "Add custom domain(customdomain.com) or leave blank".red

  say "Creating Heroku app '#{heroku_name}.herokuapp.com'".magenta
  system("heroku create #{heroku_name}")

  if config['staging']
    staging_name = ask_unless_test "What do you want to call your staging app?".red
    staging_name = "#{heroku_name}-staging"
    say "Creating staging Heroku app '#{staging_name}.herokuapp.com'".magenta
    system("heroku create #{staging_name}")
    say "Add git remote heroku for Heroku deploy.".magenta
    git :remote => "add heroku git@heroku.com:#{heroku_name}.git"
  end

  unless config['domain'].blank?
    run "heroku domains:add #{config['domain']}"
  end

  colaborators = ask_unless_test "Add collaborators? Type the email's separated by comma.".red

  if colaborators
    colaborators.split(",").map(&:strip).each do |email|
      run "heroku sharing:add #{email}"
    end
  end

  say "Adding heroku addon [PG Backups]...".magenta
  run "heroku addons:add pgbackups:plus"

  say "Adding heroku addon [Loggly]...".magenta
  run "heroku addons:add loggly:mole"

  sendgrid = ask_unless_test "Add sendgrid:starter addon?".red

  if sendgrid
    say "Adding heroku addon [Sendgrid]...".magenta
    run "heroku addons:add sendgrid:starter"
  end

  say "Pushing application to heroku...".magenta
  git :push => "heroku master" if config['deploy']
  run "heroku open" if config['deploy']
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
pah-0.0.3 lib/pah/partials/_heroku.rb
pah-0.0.2 lib/pah/partials/_heroku.rb
pah-0.0.1 lib/pah/partials/_heroku.rb