heroku_hatchet 1.2.1 → 1.3.0

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: 6494838495fd48c9286d2854cca1a316326b09c4
4
- data.tar.gz: d54287274ec3208678d4f8799e14891f9169e7a0
3
+ metadata.gz: 624b9d562e3098c7bf2cbb4a278e99bcdb04924d
4
+ data.tar.gz: a202f59856e101fcacd81a63f3017a1856e2a100
5
5
  SHA512:
6
- metadata.gz: 418375c35f800dd22a22cd12ed614c95f1e9c6221f7116c47dd5cf61cd6da1388df00746f1871f5579c880c1c498175681bb8611ac94daab5f6b4fc06ebfa463
7
- data.tar.gz: d0cf46cef54024e94158d69273d3dedf4cbd2990897dac18eb01e4e803acc45a498412c20d59685aeb0813f6c55b80fc5e9745a6db7b555b19b98ad2f0ae5561
6
+ metadata.gz: 3385a90eb29b21c89255bac6704fcbc2786dba4a22b3e709edc11bdc21bc792579858a762d15915c0025a85c8b4bf11bbe9bb0d07e3b7720a0530d924d8ade9d
7
+ data.tar.gz: e72381640b7c5b6a9427854586b87671c43786a9d02125e2ddbeec0b049b5e9604f296e6c63142104cfdf62fd32ddef68df5cd6d15fb4c7d9189753a722aa867
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  ## HEAD
2
2
 
3
+ ## 1.3.0
4
+
5
+ - `hatchet install` now clones and pulls in parallel threads
6
+ - `rake travis:setup` now ensures a git email and name is set
7
+
3
8
  ## 1.2.1
4
9
 
5
10
  - Remove debug puts
data/bin/hatchet CHANGED
@@ -12,22 +12,25 @@ $: << File.expand_path(File.dirname(File.realpath(__FILE__)) + '/../lib')
12
12
 
13
13
  require 'hatchet'
14
14
  require 'thor'
15
+ require 'threaded'
15
16
 
16
17
  class HatchetCLI < Thor
17
18
  desc "install", "installs repos defined in 'hatchet.json'"
18
19
  def install
19
20
  warn_dot_ignore!
20
21
  puts "Installing repos for hatchet"
21
- dirs.each do |directory, git_repo|
22
- directory = File.expand_path(directory)
23
- if Dir[directory].present?
24
- puts "== pulling '#{git_repo}' into '#{directory}'\n"
25
- pull(directory, git_repo)
26
- else
27
- puts "== cloning '#{git_repo}' into '#{directory}'\n"
28
- clone(directory, git_repo)
22
+ dirs.map do |directory, git_repo|
23
+ Threaded.later do
24
+ directory = File.expand_path(directory)
25
+ if Dir[directory].present?
26
+ puts "== pulling '#{git_repo}' into '#{directory}'\n"
27
+ pull(directory, git_repo)
28
+ else
29
+ puts "== cloning '#{git_repo}' into '#{directory}'\n"
30
+ clone(directory, git_repo)
31
+ end
29
32
  end
30
- end
33
+ end.map(&:join)
31
34
  end
32
35
 
33
36
  desc "list", "lists all repos and their destination listed in hatchet.json"
@@ -61,17 +64,13 @@ class HatchetCLI < Thor
61
64
  end
62
65
 
63
66
  def pull(path, git_repo)
64
- Dir.chdir(path) do
65
- `git pull --rebase #{git_repo} master`
66
- end
67
+ `cd #{path} && git pull --rebase #{git_repo} master`
67
68
  end
68
69
 
69
70
  def clone(path, git_repo)
70
71
  path = File.join(path, '..') # up one dir to prevent repos/codetriage/codetriage/#...
71
- FileUtils.mkdir_p(path) # create directory
72
- Dir.chdir(path) do
73
- `git clone #{git_repo}`
74
- end
72
+ FileUtils.mkdir_p(path)
73
+ `cd #{path} && git clone #{git_repo}`
75
74
  end
76
75
  end
77
76
 
data/hatchet.gemspec CHANGED
@@ -18,17 +18,18 @@ Gem::Specification.new do |gem|
18
18
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
19
19
  gem.require_paths = ["lib"]
20
20
 
21
- gem.add_dependency "heroku-api"
22
- gem.add_dependency "activesupport"
23
- gem.add_dependency "rrrretry"
24
- gem.add_dependency "anvil-cli"
25
- gem.add_dependency "excon"
26
- gem.add_dependency "thor"
27
- gem.add_dependency 'repl_runner'
21
+ gem.add_dependency "heroku-api", "~> 0"
22
+ gem.add_dependency "activesupport", "~> 3"
23
+ gem.add_dependency "rrrretry", "~> 0"
24
+ gem.add_dependency "anvil-cli", "~> 0"
25
+ gem.add_dependency "excon", "~> 0"
26
+ gem.add_dependency "thor", "~> 0"
27
+ gem.add_dependency "repl_runner", "~> 0"
28
+ gem.add_dependency "threaded", "~> 0"
28
29
 
29
30
 
30
- gem.add_development_dependency "rake"
31
- gem.add_development_dependency "mocha"
32
- gem.add_development_dependency "parallel_tests"
31
+ gem.add_development_dependency "rake", "~> 0"
32
+ gem.add_development_dependency "mocha", "~> 0"
33
+ gem.add_development_dependency "parallel_tests", "~> 0"
33
34
  end
34
35
 
data/lib/hatchet/tasks.rb CHANGED
@@ -13,14 +13,16 @@ namespace :hatchet do
13
13
  puts "== Setting Up Travis =="
14
14
  [
15
15
  "bundle exec hatchet install",
16
+ "if [ `git config --get user.email` ]; then echo 'already set'; else `git config --global user.email 'buildpack@example.com'`; fi",
17
+ "if [ `git config --get user.name` ]; then echo 'already set'; else `git config --global user.name 'BuildpackTester'` ; fi",
16
18
  "echo '#{config_ssh}' >> ~/.ssh/config",
17
19
  "curl --fail --retry 3 --retry-delay 1 --connect-timeout 3 --max-time 30 https://toolbelt.heroku.com/install-ubuntu.sh | sh",
18
20
  "yes | heroku keys:add"
19
21
  ].each do |command|
20
22
  puts "== Running: #{command}"
21
23
  Bundler.with_clean_env do
22
- `#{command}`
23
- raise "Command failed: #{command.inspect}" unless $?.success?
24
+ result = `#{command}`
25
+ raise "Command failed: #{command.inspect}\nResult: #{result}" unless $?.success?
24
26
  end
25
27
  end
26
28
  puts "== Done =="
@@ -32,4 +34,5 @@ namespace :hatchet do
32
34
  `#{command}`
33
35
  end
34
36
  end
35
- end
37
+ end
38
+
@@ -1,3 +1,3 @@
1
1
  module Hatchet
2
- VERSION = "1.2.1"
2
+ VERSION = "1.3.0"
3
3
  end
@@ -0,0 +1,20 @@
1
+ require 'test_helper'
2
+
3
+ class EditRepoTest < Test::Unit::TestCase
4
+ def test_can_deploy_git_app
5
+ Hatchet::GitApp.new("rails3_mri_193").in_directory do |app|
6
+ msg = `touch foo`
7
+ assert $?.success?, msg
8
+
9
+ msg = `git add .; git commit -m foo`
10
+ assert $?.success?, msg
11
+
12
+ assert_match "foo", `ls`
13
+ end
14
+
15
+ Hatchet::GitApp.new("rails3_mri_193").in_directory do |app|
16
+ refute_match "foo", `ls`
17
+ end
18
+ end
19
+ end
20
+
metadata CHANGED
@@ -1,153 +1,167 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: heroku_hatchet
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Richard Schneeman
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-03 00:00:00.000000000 Z
11
+ date: 2014-02-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: heroku-api
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: '0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ">="
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: activesupport
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ">="
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '0'
33
+ version: '3'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ">="
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '0'
40
+ version: '3'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rrrretry
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ">="
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ">="
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: anvil-cli
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ">="
59
+ - - "~>"
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ">="
66
+ - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: excon
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ">="
73
+ - - "~>"
74
74
  - !ruby/object:Gem::Version
75
75
  version: '0'
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - ">="
80
+ - - "~>"
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: thor
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - ">="
87
+ - - "~>"
88
88
  - !ruby/object:Gem::Version
89
89
  version: '0'
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - ">="
94
+ - - "~>"
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: repl_runner
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - ">="
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :runtime
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: threaded
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - "~>"
102
116
  - !ruby/object:Gem::Version
103
117
  version: '0'
104
118
  type: :runtime
105
119
  prerelease: false
106
120
  version_requirements: !ruby/object:Gem::Requirement
107
121
  requirements:
108
- - - ">="
122
+ - - "~>"
109
123
  - !ruby/object:Gem::Version
110
124
  version: '0'
111
125
  - !ruby/object:Gem::Dependency
112
126
  name: rake
113
127
  requirement: !ruby/object:Gem::Requirement
114
128
  requirements:
115
- - - ">="
129
+ - - "~>"
116
130
  - !ruby/object:Gem::Version
117
131
  version: '0'
118
132
  type: :development
119
133
  prerelease: false
120
134
  version_requirements: !ruby/object:Gem::Requirement
121
135
  requirements:
122
- - - ">="
136
+ - - "~>"
123
137
  - !ruby/object:Gem::Version
124
138
  version: '0'
125
139
  - !ruby/object:Gem::Dependency
126
140
  name: mocha
127
141
  requirement: !ruby/object:Gem::Requirement
128
142
  requirements:
129
- - - ">="
143
+ - - "~>"
130
144
  - !ruby/object:Gem::Version
131
145
  version: '0'
132
146
  type: :development
133
147
  prerelease: false
134
148
  version_requirements: !ruby/object:Gem::Requirement
135
149
  requirements:
136
- - - ">="
150
+ - - "~>"
137
151
  - !ruby/object:Gem::Version
138
152
  version: '0'
139
153
  - !ruby/object:Gem::Dependency
140
154
  name: parallel_tests
141
155
  requirement: !ruby/object:Gem::Requirement
142
156
  requirements:
143
- - - ">="
157
+ - - "~>"
144
158
  - !ruby/object:Gem::Version
145
159
  version: '0'
146
160
  type: :development
147
161
  prerelease: false
148
162
  version_requirements: !ruby/object:Gem::Requirement
149
163
  requirements:
150
- - - ">="
164
+ - - "~>"
151
165
  - !ruby/object:Gem::Version
152
166
  version: '0'
153
167
  description: Hatchet is a an integration testing library for developing Heroku buildpacks.
@@ -215,6 +229,7 @@ files:
215
229
  - test/hatchet/allow_failure_git_test.rb
216
230
  - test/hatchet/anvil_test.rb
217
231
  - test/hatchet/config_test.rb
232
+ - test/hatchet/edit_repo_test.rb
218
233
  - test/hatchet/git_test.rb
219
234
  - test/hatchet/heroku_api_test.rb
220
235
  - test/hatchet/labs_test.rb
@@ -286,6 +301,7 @@ test_files:
286
301
  - test/hatchet/allow_failure_git_test.rb
287
302
  - test/hatchet/anvil_test.rb
288
303
  - test/hatchet/config_test.rb
304
+ - test/hatchet/edit_repo_test.rb
289
305
  - test/hatchet/git_test.rb
290
306
  - test/hatchet/heroku_api_test.rb
291
307
  - test/hatchet/labs_test.rb