Class: Provisioner::CLI

Inherits:
Thor
  • Object
show all
Includes:
Term::ANSIColor
Defined in:
lib/provisioner/cli.rb

Instance Method Summary collapse

Instance Method Details

#new(heroku_app_name) ⇒ Object



9
10
11
12
13
14
15
16
# File 'lib/provisioner/cli.rb', line 9

def new(heroku_app_name)

  print "\n"
  print green + "Creating new Heroku instance." + clear + "\n"
  system "heroku create #{heroku_app_name} --stack cedar"
  setup(heroku_app_name)
  
end


74
75
76
77
78
79
80
81
82
83
# File 'lib/provisioner/cli.rb', line 74

def paid(heroku_app_name)

  app_flag = " --app #{heroku_app_name}"

  print "\n"
  print green + "Enabling the basic Hoptoad error notification package." + clear + "\n"
  system "heroku addons:add hoptoad:basic" + app_flag
  print "\n"
  
end

#setup(heroku_app_name) ⇒ Object



19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# File 'lib/provisioner/cli.rb', line 19

def setup(heroku_app_name)

  app_flag = " --app #{heroku_app_name}"

  # add email deployment notifications.
  print "\n"
  print green + "Enabling email deploy notifications." + clear + "\n"
  print green + "We'll open a page where you can configure the email addresses to notify." + clear + "\n"
  system "heroku addons:add deployhooks:email" + app_flag
  system "open https://api.heroku.com/myapps/#{heroku_app_name}/addons/deployhooks:email"
  print "\n"

  # # add standardized staging error pages.
  # print green + "Configuring helpful error and maintenance pages for staging." + clear + "\n"
  # system "heroku config:add ERROR_PAGE_URL=http://wearetitans.net/staging/error MAINTENANCE_PAGE_URL=http://wearetitans.net/staging/maintenance" + app_flag

  print green + "Enabling daily cron." + clear + "\n"
  system "heroku addons:add cron:daily" + app_flag
  print "\n"

  print green + "Enabling the standard New Relic package." + clear + "\n"
  system "heroku addons:add newrelic:standard" + app_flag
  print "\n"
  
  print green + "Enabling daily database backups with one week retention." + clear + "\n"
  system "heroku addons:add pgbackups:auto-week" + app_flag
  print "\n"
  
  print green + "Enabling emails through SendGrid's starter package." + clear + "\n"
  system "heroku addons:add sendgrid:starter" + app_flag
  print "\n"
  
  print green + "Enabling piggy-back SSL." + clear + "\n"
  system "heroku addons:add ssl:piggyback" + app_flag
  print "\n"
  
  print green + "Enabling basic Still Alive service." + clear + "\n"
  system "heroku addons:add stillalive:basic" + app_flag
  print "\n"
  
  print green + "Upgrading logging to expanded. (Still free.)" + clear + "\n"
  system "heroku addons:upgrade logging:expanded" + app_flag
  print "\n"
  
  # print green + "Enabling custom domains."
  # system "heroku addons:add custom_domains:basic" + app_flag
  # 
  # # add titan's staging url
  # if environment == 'staging'
  #   system "heroku domains:add #{heroku_app_name}.staging.titanclients.com" + app_flag
  # end

end