shred 0.0.9 → 0.0.10

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 775369f38e6bd298fe27b872674df05bca3d81f7
4
- data.tar.gz: af19387480d59824f28a87534781f2ff48c724c9
3
+ metadata.gz: a2ed654059cd02d6db5d1bdb27d7922765f7ab1f
4
+ data.tar.gz: 95146a0bc900ae1796440b68a4bcfbe44deeb89b
5
5
  SHA512:
6
- metadata.gz: 52d4539329068e33cbbb8329fc1635a8625860a8efae3133d16ccb6b6513047fbc0eb3790e9e0738df3768663f49f231d79956995ea078320c305834bd4a6391
7
- data.tar.gz: d2b099a1e501692753e967f1c9f002efb30f797ce4895023d4aa1b287901988f6ce5fc5be0e9f5f28117f5998a9b1358618f9ca75432d193b7cb06cf4b9efc99
6
+ metadata.gz: 2345cd203d5e8a765a294bc4892dc5a4299238b5c03775aa8d9ee874d80c5271638270ab2bb1f06dd3a320a6c4e7f831aa7909f9deb1a6df5f935a30431a5783
7
+ data.tar.gz: 92dd78fb1777aabf2608de1510b82434ad4ba7c30c40192f0d2a0ae1ef68abeece3578f8ed8f075584c3da09d1068b95bfd36b62ce69c7a9ba380054cbab452b
data/lib/shred.rb CHANGED
@@ -4,6 +4,7 @@ require 'shred/commands/deploy'
4
4
  require 'shred/commands/dotenv'
5
5
  require 'shred/commands/dynamo_db'
6
6
  require 'shred/commands/elasticsearch'
7
+ require 'shred/commands/heroku'
7
8
  require 'shred/commands/js_deps'
8
9
  require 'shred/commands/platform_deps'
9
10
  require 'shred/commands/ruby_deps'
@@ -77,6 +78,10 @@ module Shred
77
78
  desc 'deploy SUBCOMMAND ...ARGS', 'Deploy the application'
78
79
  subcommand 'deploy', Commands::Deploy
79
80
  end
81
+ if commands.key?('heroku')
82
+ desc 'heroku SUBCOMMAND ...ARGS', 'Manage the deployed application in Heroku'
83
+ subcommand 'heroku', Commands::Heroku
84
+ end
80
85
  if commands.key?('setup')
81
86
  desc 'setup', 'First-time application setup'
82
87
  def setup
data/lib/shred.yml.tt CHANGED
@@ -55,6 +55,11 @@ commands:
55
55
  - thor stories:create
56
56
  import:
57
57
  - thor stories:index
58
+ heroku:
59
+ staging:
60
+ app_name: <%= app_name %>-staging
61
+ production:
62
+ app_name: <%= app_name %>-production
58
63
  js_deps:
59
64
  platform_deps:
60
65
  homebrew:
@@ -0,0 +1,36 @@
1
+ require 'dotenv'
2
+ require 'platform-api'
3
+ require 'shred/commands/base'
4
+
5
+ module Shred
6
+ module Commands
7
+ class Heroku < Base
8
+ desc 'restartall ENVIRONMENT', 'Restart all app dynos'
9
+ long_desc <<-LONGDESC
10
+ Restarts all of the application's dynos.
11
+
12
+ Consults the commands.heroku.<environment>.app_name config item to determine which Heroku
13
+ app to restart.
14
+ LONGDESC
15
+ def restartall(environment)
16
+ app_name = cfg("#{environment}.app_name")
17
+ connection.dyno.restart_all(app_name)
18
+ console.say_ok("Restarted all dynos for #{app_name}")
19
+ end
20
+
21
+ no_commands do
22
+ def connection
23
+ @connection ||= begin
24
+ ::Dotenv.load
25
+ begin
26
+ PlatformAPI.connect_oauth(ENV['HEROKU_DEPLOY_TOKEN'])
27
+ rescue Excon::Errors::Unauthorized
28
+ console.say_err("Access to Heroku is not authorized. Did you set the HEROKU_DEPLOY_TOKEN environment variable?")
29
+ exit(1)
30
+ end
31
+ end
32
+ end
33
+ end
34
+ end
35
+ end
36
+ end
data/lib/shred/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Shred
2
- VERSION = '0.0.9'
2
+ VERSION = '0.0.10'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shred
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.0.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-10-16 00:00:00.000000000 Z
12
+ date: 2014-11-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -135,6 +135,7 @@ files:
135
135
  - lib/shred/commands/dotenv.rb
136
136
  - lib/shred/commands/dynamo_db.rb
137
137
  - lib/shred/commands/elasticsearch.rb
138
+ - lib/shred/commands/heroku.rb
138
139
  - lib/shred/commands/js_deps.rb
139
140
  - lib/shred/commands/platform_deps.rb
140
141
  - lib/shred/commands/ruby_deps.rb