puppet-blacksmith 1.0.2 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/puppet_blacksmith/rake_tasks.rb +9 -3
- metadata +75 -68
@@ -2,6 +2,7 @@ require 'rake'
|
|
2
2
|
require 'rest-client'
|
3
3
|
require 'puppet'
|
4
4
|
require 'yaml'
|
5
|
+
require 'nokogiri'
|
5
6
|
|
6
7
|
namespace :module do
|
7
8
|
desc "Bump module version to the next minor"
|
@@ -43,6 +44,7 @@ password: mypassword")
|
|
43
44
|
forge = credentials['forge'] || "https://forge.puppetlabs.com"
|
44
45
|
|
45
46
|
# login to the puppet forge
|
47
|
+
puts "Logging into Puppet Forge as user #{credentials['username']}"
|
46
48
|
response = RestClient.post(
|
47
49
|
"#{forge}/login",
|
48
50
|
{'username' => credentials['username'], 'password' => credentials['password']}){
|
@@ -53,11 +55,13 @@ password: mypassword")
|
|
53
55
|
response.return!(request, result, &block)
|
54
56
|
end
|
55
57
|
}
|
56
|
-
|
58
|
+
fail("Failed to login to Puppet Forge: cookies not set correctly") unless response.cookies['auth']
|
57
59
|
|
58
60
|
# upload the file
|
61
|
+
package = "pkg/#{m.username}-#{m.name}-#{m.version}.tar.gz"
|
62
|
+
puts "Uploading #{package} to Puppet Forge #{m.username}/#{m.name}"
|
59
63
|
response = RestClient.post("#{forge}/#{m.username}/#{m.name}/upload",
|
60
|
-
{:notes => "Auto uploaded", :tarball => File.new(
|
64
|
+
{:notes => "Auto uploaded", :tarball => File.new(package, 'rb') },
|
61
65
|
{:cookies => response.cookies}){
|
62
66
|
|response, request, result, &block|
|
63
67
|
if [301, 302, 307].include? response.code
|
@@ -66,7 +70,9 @@ password: mypassword")
|
|
66
70
|
response.return!(request, result, &block)
|
67
71
|
end
|
68
72
|
}
|
69
|
-
|
73
|
+
page = Nokogiri::HTML(response.body)
|
74
|
+
errors = page.css('.errors')
|
75
|
+
fail("Error uploading module #{package} to Puppet Forge #{m.username}/#{m.name}:#{errors.text}") unless errors.empty?
|
70
76
|
end
|
71
77
|
end
|
72
78
|
|
metadata
CHANGED
@@ -1,131 +1,138 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: puppet-blacksmith
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.2
|
3
|
+
version: !ruby/object:Gem::Version
|
5
4
|
prerelease:
|
5
|
+
version: 1.0.3
|
6
6
|
platform: ruby
|
7
|
-
authors:
|
7
|
+
authors:
|
8
8
|
- MaestroDev
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
|
13
|
-
|
14
|
-
|
12
|
+
|
13
|
+
date: 2013-02-06 00:00:00 Z
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
15
16
|
name: rake
|
16
|
-
requirement: &
|
17
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
17
18
|
none: false
|
18
|
-
requirements:
|
19
|
-
- -
|
20
|
-
- !ruby/object:Gem::Version
|
21
|
-
version:
|
19
|
+
requirements:
|
20
|
+
- - ">="
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: "0"
|
22
23
|
type: :runtime
|
23
24
|
prerelease: false
|
24
|
-
version_requirements: *
|
25
|
-
- !ruby/object:Gem::Dependency
|
25
|
+
version_requirements: *id001
|
26
|
+
- !ruby/object:Gem::Dependency
|
26
27
|
name: rest-client
|
27
|
-
requirement: &
|
28
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
28
29
|
none: false
|
29
|
-
requirements:
|
30
|
-
- -
|
31
|
-
- !ruby/object:Gem::Version
|
32
|
-
version:
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: "0"
|
33
34
|
type: :runtime
|
34
35
|
prerelease: false
|
35
|
-
version_requirements: *
|
36
|
-
- !ruby/object:Gem::Dependency
|
36
|
+
version_requirements: *id002
|
37
|
+
- !ruby/object:Gem::Dependency
|
37
38
|
name: puppet
|
38
|
-
requirement: &
|
39
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
39
40
|
none: false
|
40
|
-
requirements:
|
41
|
-
- -
|
42
|
-
- !ruby/object:Gem::Version
|
41
|
+
requirements:
|
42
|
+
- - ">="
|
43
|
+
- !ruby/object:Gem::Version
|
43
44
|
version: 2.7.16
|
44
45
|
type: :runtime
|
45
46
|
prerelease: false
|
46
|
-
version_requirements: *
|
47
|
-
- !ruby/object:Gem::Dependency
|
47
|
+
version_requirements: *id003
|
48
|
+
- !ruby/object:Gem::Dependency
|
48
49
|
name: puppetlabs_spec_helper
|
49
|
-
requirement: &
|
50
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
50
51
|
none: false
|
51
|
-
requirements:
|
52
|
-
- -
|
53
|
-
- !ruby/object:Gem::Version
|
52
|
+
requirements:
|
53
|
+
- - ">="
|
54
|
+
- !ruby/object:Gem::Version
|
54
55
|
version: 0.3.0
|
55
56
|
type: :runtime
|
56
57
|
prerelease: false
|
57
|
-
version_requirements: *
|
58
|
-
- !ruby/object:Gem::Dependency
|
58
|
+
version_requirements: *id004
|
59
|
+
- !ruby/object:Gem::Dependency
|
59
60
|
name: cucumber
|
60
|
-
requirement: &
|
61
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
61
62
|
none: false
|
62
|
-
requirements:
|
63
|
-
- -
|
64
|
-
- !ruby/object:Gem::Version
|
65
|
-
version:
|
63
|
+
requirements:
|
64
|
+
- - ">="
|
65
|
+
- !ruby/object:Gem::Version
|
66
|
+
version: "0"
|
66
67
|
type: :development
|
67
68
|
prerelease: false
|
68
|
-
version_requirements: *
|
69
|
-
- !ruby/object:Gem::Dependency
|
69
|
+
version_requirements: *id005
|
70
|
+
- !ruby/object:Gem::Dependency
|
70
71
|
name: aruba
|
71
|
-
requirement: &
|
72
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
72
73
|
none: false
|
73
|
-
requirements:
|
74
|
-
- -
|
75
|
-
- !ruby/object:Gem::Version
|
76
|
-
version:
|
74
|
+
requirements:
|
75
|
+
- - ">="
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: "0"
|
77
78
|
type: :development
|
78
79
|
prerelease: false
|
79
|
-
version_requirements: *
|
80
|
-
- !ruby/object:Gem::Dependency
|
80
|
+
version_requirements: *id006
|
81
|
+
- !ruby/object:Gem::Dependency
|
81
82
|
name: rspec
|
82
|
-
requirement: &
|
83
|
+
requirement: &id007 !ruby/object:Gem::Requirement
|
83
84
|
none: false
|
84
|
-
requirements:
|
85
|
-
- -
|
86
|
-
- !ruby/object:Gem::Version
|
85
|
+
requirements:
|
86
|
+
- - ">="
|
87
|
+
- !ruby/object:Gem::Version
|
87
88
|
version: 2.7.0
|
88
89
|
type: :development
|
89
90
|
prerelease: false
|
90
|
-
version_requirements: *
|
91
|
+
version_requirements: *id007
|
91
92
|
description: Puppet module tools for development and Puppet Forge management
|
92
|
-
email:
|
93
|
+
email:
|
93
94
|
- info@maestrodev.com
|
94
95
|
executables: []
|
96
|
+
|
95
97
|
extensions: []
|
98
|
+
|
96
99
|
extra_rdoc_files: []
|
97
|
-
|
100
|
+
|
101
|
+
files:
|
98
102
|
- lib/puppet_blacksmith/rake_tasks.rb
|
99
103
|
- LICENSE
|
100
104
|
- spec/puppet_blacksmith/rake_tasks_spec.rb
|
101
105
|
- spec/data/Modulefile
|
102
106
|
homepage: http://github.com/maestrodev/puppet-blacksmith
|
103
107
|
licenses: []
|
108
|
+
|
104
109
|
post_install_message:
|
105
110
|
rdoc_options: []
|
106
|
-
|
111
|
+
|
112
|
+
require_paths:
|
107
113
|
- lib
|
108
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
114
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
109
115
|
none: false
|
110
|
-
requirements:
|
111
|
-
- -
|
112
|
-
- !ruby/object:Gem::Version
|
113
|
-
|
114
|
-
segments:
|
116
|
+
requirements:
|
117
|
+
- - ">="
|
118
|
+
- !ruby/object:Gem::Version
|
119
|
+
hash: 3569930300480509589
|
120
|
+
segments:
|
115
121
|
- 0
|
116
|
-
|
117
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
122
|
+
version: "0"
|
123
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
118
124
|
none: false
|
119
|
-
requirements:
|
120
|
-
- -
|
121
|
-
- !ruby/object:Gem::Version
|
122
|
-
version:
|
125
|
+
requirements:
|
126
|
+
- - ">="
|
127
|
+
- !ruby/object:Gem::Version
|
128
|
+
version: "0"
|
123
129
|
requirements: []
|
130
|
+
|
124
131
|
rubyforge_project:
|
125
132
|
rubygems_version: 1.8.6
|
126
133
|
signing_key:
|
127
134
|
specification_version: 3
|
128
135
|
summary: Tasks to manage Puppet module builds
|
129
|
-
test_files:
|
136
|
+
test_files:
|
130
137
|
- spec/puppet_blacksmith/rake_tasks_spec.rb
|
131
138
|
- spec/data/Modulefile
|