heroku_hatchet 3.0.3 → 3.0.4

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
- SHA1:
3
- metadata.gz: e9898ba7bdc65d51d6325bde26c4e535e1be6a6a
4
- data.tar.gz: 44a7a2d536cb66d078aae101d9f83c749038a40a
2
+ SHA256:
3
+ metadata.gz: 2232e915c2444063e2edd617e6d7716b6138b244160ef5a8e5db9989a79847f9
4
+ data.tar.gz: adc957bb9149aa82f9baff2ce7b367142de221e826bbbbfc5d0565f6940e71bb
5
5
  SHA512:
6
- metadata.gz: aebf4597dc112b0974fe619e12d61609967098616ad69f9a5280c51e84e596c26abfd87aac41933966ecdc1f5cb760551973d97e943af0e17b5c13417ef6c5c6
7
- data.tar.gz: a5445945bc151a63295b62169e5832a4b1910591d4f95830e97d3a8e21b57c6004706f290ecf5e6cbc32e683c237bfdb89fbafb5f5477cb48baa6b5d3c84efea
6
+ metadata.gz: 778fd671f3288ecf3d053c4d56a68d58ebbda4fad16c5a64abe69e29eb78ab73f4b3c0d78521d12a8c17b3764b8d9803c54ab03abcc1563b85934d500798159b
7
+ data.tar.gz: ba285850e14f0f53c8b416de2e4be2a20c86caee53ccec5c8b60ecb8b6b0e6c6c0bff8a285d84fabe3d7591dc9f4a145abc652d8ba59130ca9846a07b673e511
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  ## HEAD
2
2
 
3
+ ## 3.0.4
4
+
5
+ - Remove Heroku constants
6
+
3
7
  ## 3.0.2
4
8
 
5
9
  - SSH no longer needed for travis setup
data/README.md CHANGED
@@ -41,6 +41,33 @@ $ travis encrypt HEROKU_API_USER=<example@example.com> --add
41
41
 
42
42
  If you're running locally, your system credentials will be pulled from `heroku auth:token`
43
43
 
44
+ You'll also need to trigger a "setup" step for CI tasks. There is a setup task you can use first you need to require it, likely in your Rakefile:
45
+
46
+ ```ruby
47
+ require 'hatchet/tasks'
48
+ ```
49
+
50
+ Then execute the script `hatchet:setup_ci`. You can do it on Travis CI like this:
51
+
52
+ ```
53
+ # .travis.yml
54
+ before_script: bundle exec rake hatchet:setup_ci
55
+ ```
56
+
57
+ and on Heroku CI like this:
58
+
59
+ ```json
60
+ {
61
+ "environments": {
62
+ "test": {
63
+ "scripts": {
64
+ "test-setup": "bundle exec rake hatchet:setup_ci",
65
+ }
66
+ }
67
+ }
68
+ }
69
+ ```
70
+
44
71
  ## Run the Tests
45
72
 
46
73
  $ bundle exec rake test
data/bin/hatchet CHANGED
@@ -44,9 +44,9 @@ class HatchetCLI < Thor
44
44
  desc "destroy [NAME]", "Deletes applications"
45
45
  option :all, :type => :boolean
46
46
  def destroy(name=nil)
47
- api_key = ENV['HEROKU_API_KEY'] || bundle_exec {`heroku auth:token`.chomp }
48
- heroku = Heroku::API.new(api_key: api_key)
49
- reaper = Hatchet::Reaper.new(heroku)
47
+ api_key = ENV['HEROKU_API_KEY'] || bundle_exec {`heroku auth:token`.chomp }
48
+ platform_api = PlatformAPI.connect_oauth(api_key, cache: Moneta.new(:Null))
49
+ reaper = Reaper.new(platform_api: platform_api)
50
50
 
51
51
  if options[:all]
52
52
  reaper.destroy_all
data/hatchet.gemspec CHANGED
@@ -19,9 +19,7 @@ Gem::Specification.new do |gem|
19
19
  gem.require_paths = ["lib"]
20
20
 
21
21
  gem.add_dependency "platform-api", "~> 2"
22
- gem.add_dependency "activesupport", "~> 5"
23
22
  gem.add_dependency "rrrretry", "~> 1"
24
- gem.add_dependency "anvil-cli", "~> 0"
25
23
  gem.add_dependency "excon", "~> 0"
26
24
  gem.add_dependency "thor", "~> 0"
27
25
  gem.add_dependency "repl_runner", "~> 0.0.3"
data/lib/hatchet/app.rb CHANGED
@@ -129,8 +129,8 @@ module Hatchet
129
129
  hash = { name: name, stack: stack }
130
130
  hash.delete_if { |k,v| v.nil? }
131
131
  platform_api.app.create(hash)
132
- rescue Heroku::API::Errors::RequestFailed => e
133
- @reaper.cycle if e.message.match(/app limit/)
132
+ rescue
133
+ @reaper.cycle
134
134
  raise e
135
135
  end
136
136
  end
@@ -225,7 +225,6 @@ module Hatchet
225
225
 
226
226
  def heroku
227
227
  raise "Not supported, use `platform_api` instead."
228
- @heroku ||= Heroku::API.new(api_key: api_key)
229
228
  end
230
229
 
231
230
  def run_ci(timeout: 300, &block)
@@ -48,7 +48,7 @@ module Hatchet
48
48
  path = possible_paths.detect do |path|
49
49
  Dir[path].present?
50
50
  end
51
- raise BadRepoName.new(name, possible_paths) if path.blank?
51
+ raise BadRepoName.new(name, possible_paths) if path.nil? || path.empty?
52
52
  path
53
53
  end
54
54
 
@@ -40,11 +40,6 @@ module Hatchet
40
40
  def destroy_oldest
41
41
  oldest = @hatchet_apps.pop
42
42
  destroy_by_id(name: oldest["name"], id: oldest["id"], details: "Hatchet app limit: #{HATCHET_APP_LIMT}")
43
- rescue Heroku::API::Errors::NotFound, Excon::Error::NotFound => e
44
- puts "Error while destroying an app, maybe it's already deleted?"
45
- puts oldest.inspect
46
- puts e.inspect
47
- # app already deleted, cycle will catch if there's still too many
48
43
  end
49
44
 
50
45
  def destroy_all
@@ -1,3 +1,3 @@
1
1
  module Hatchet
2
- VERSION = "3.0.3"
2
+ VERSION = "3.0.4"
3
3
  end
data/lib/hatchet.rb CHANGED
@@ -1,4 +1,3 @@
1
- require 'anvil/engine'
2
1
  require 'active_support/core_ext/object/blank'
3
2
  require 'rrrretry'
4
3
  require 'repl_runner'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: heroku_hatchet
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.3
4
+ version: 3.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Richard Schneeman
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-08-12 00:00:00.000000000 Z
11
+ date: 2017-10-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: platform-api
@@ -24,20 +24,6 @@ dependencies:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '2'
27
- - !ruby/object:Gem::Dependency
28
- name: activesupport
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - "~>"
32
- - !ruby/object:Gem::Version
33
- version: '5'
34
- type: :runtime
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - "~>"
39
- - !ruby/object:Gem::Version
40
- version: '5'
41
27
  - !ruby/object:Gem::Dependency
42
28
  name: rrrretry
43
29
  requirement: !ruby/object:Gem::Requirement
@@ -52,20 +38,6 @@ dependencies:
52
38
  - - "~>"
53
39
  - !ruby/object:Gem::Version
54
40
  version: '1'
55
- - !ruby/object:Gem::Dependency
56
- name: anvil-cli
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - "~>"
60
- - !ruby/object:Gem::Version
61
- version: '0'
62
- type: :runtime
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - "~>"
67
- - !ruby/object:Gem::Version
68
- version: '0'
69
41
  - !ruby/object:Gem::Dependency
70
42
  name: excon
71
43
  requirement: !ruby/object:Gem::Requirement
@@ -268,7 +240,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
268
240
  version: '0'
269
241
  requirements: []
270
242
  rubyforge_project:
271
- rubygems_version: 2.6.11
243
+ rubygems_version: 2.6.14
272
244
  signing_key:
273
245
  specification_version: 4
274
246
  summary: Hatchet is a an integration testing library for developing Heroku buildpacks.