zenslap 0.2.6 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/bin/zenslap +56 -34
- data/zenslap.gemspec +2 -2
- metadata +10 -11
data/bin/zenslap
CHANGED
@@ -4,40 +4,62 @@ require 'rubygems'
|
|
4
4
|
require 'heroku'
|
5
5
|
require 'heroku/command'
|
6
6
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
end
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
7
|
+
module Zenslap
|
8
|
+
extend self
|
9
|
+
|
10
|
+
module GitConfig
|
11
|
+
extend self
|
12
|
+
|
13
|
+
def zenslap_app
|
14
|
+
@app ||= begin
|
15
|
+
name = %x{ git config zenslap.zenslap }
|
16
|
+
name != "" && name
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
def zenslap_app=(name)
|
21
|
+
system "git config zenslap.zenslap #{name}"
|
22
|
+
name
|
23
|
+
end
|
24
|
+
|
25
|
+
def github_repository
|
26
|
+
@github_repository ||= begin
|
27
|
+
github_url = `git config --get remote.origin.url`
|
28
|
+
github_repository = github_url[/github.com.(.+)/, 1].gsub(/\.git$/, "")
|
29
|
+
error_out "Unable to find a github repository in git config" unless github_repository
|
30
|
+
github_repository
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
private
|
35
|
+
def error_out(message)
|
36
|
+
puts message
|
37
|
+
exit 1
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
module Heroku
|
42
|
+
extend self
|
43
|
+
|
44
|
+
def find_app
|
45
|
+
puts "Searching for zenslap build environment on heroku"
|
46
|
+
app = client.list.map{|a|a[0]}.find do |app|
|
47
|
+
client.config_vars(app)['ZENSLAP_GITHUB_REPOSITORY'] == GitConfig.github_repository
|
48
|
+
end
|
49
|
+
error_out "Failed!" unless app
|
50
|
+
puts "Found #{app}"
|
51
|
+
app
|
52
|
+
end
|
53
|
+
|
54
|
+
private
|
55
|
+
def client
|
56
|
+
@client ||= ::Heroku::Auth.client
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
def app
|
61
|
+
GitConfig.zenslap_app ||= Heroku.find_app
|
39
62
|
end
|
40
|
-
name
|
41
63
|
end
|
42
64
|
|
43
|
-
exec "heroku #{ARGV.join(" ")} --app #{app}"
|
65
|
+
exec "heroku #{ARGV.join(" ")} --app #{Zenslap.app}"
|
data/zenslap.gemspec
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{zenslap}
|
8
|
-
s.version = "0.
|
8
|
+
s.version = "0.3.1"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["opsb"]
|
@@ -22,6 +22,6 @@ Gem::Specification.new do |s|
|
|
22
22
|
s.rubygems_version = %q{1.3.7}
|
23
23
|
s.summary = %q{Client for zenslap continuous integration}
|
24
24
|
s.test_files = Dir.glob("spec/**/*")
|
25
|
-
s.add_dependency('heroku', ["~>
|
25
|
+
s.add_dependency('heroku', ["~> 2.0"])
|
26
26
|
end
|
27
27
|
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zenslap
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
5
|
-
prerelease:
|
4
|
+
hash: 17
|
5
|
+
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
-
|
10
|
-
version: 0.
|
8
|
+
- 3
|
9
|
+
- 1
|
10
|
+
version: 0.3.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- opsb
|
@@ -26,12 +26,11 @@ dependencies:
|
|
26
26
|
requirements:
|
27
27
|
- - ~>
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
hash:
|
29
|
+
hash: 3
|
30
30
|
segments:
|
31
|
-
-
|
32
|
-
-
|
33
|
-
|
34
|
-
version: 1.17.8
|
31
|
+
- 2
|
32
|
+
- 0
|
33
|
+
version: "2.0"
|
35
34
|
type: :runtime
|
36
35
|
version_requirements: *id001
|
37
36
|
description: Client for zenslap continuous integration
|
@@ -75,7 +74,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
75
74
|
requirements: []
|
76
75
|
|
77
76
|
rubyforge_project:
|
78
|
-
rubygems_version: 1.
|
77
|
+
rubygems_version: 1.3.7
|
79
78
|
signing_key:
|
80
79
|
specification_version: 3
|
81
80
|
summary: Client for zenslap continuous integration
|