jpi 0.3.7 → 0.3.8
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +12 -2
- data/features/create-new-plugin.feature +7 -11
- data/features/{support/create_new_plugin_steps.rb → step_definitions/new_steps.rb} +1 -5
- data/features/support/directory_structure.rb +20 -18
- data/features/support/env.rb +1 -0
- data/features/support/workdir.rb +13 -0
- data/jpi.gemspec +5 -5
- data/lib/jenkins/plugin/version.rb +2 -2
- metadata +215 -163
- data/features/support/work.rb +0 -20
data/Rakefile
CHANGED
@@ -1,4 +1,6 @@
|
|
1
1
|
require 'bundler'
|
2
|
+
require 'cucumber/rake/task'
|
3
|
+
|
2
4
|
class Bundler::GemHelper
|
3
5
|
def version_tag
|
4
6
|
"jpi-v#{version}"
|
@@ -6,6 +8,14 @@ class Bundler::GemHelper
|
|
6
8
|
install_tasks
|
7
9
|
end
|
8
10
|
|
9
|
-
|
10
|
-
|
11
|
+
namespace :cucumber do
|
12
|
+
Cucumber::Rake::Task.new(:ok, 'Run features that are being worked on') do |t|
|
13
|
+
t.cucumber_opts = "--tags ~@wip"
|
14
|
+
end
|
15
|
+
Cucumber::Rake::Task.new(:wip, 'Run features that are being worked on') do |t|
|
16
|
+
t.cucumber_opts = "--tags @wip"
|
17
|
+
end
|
18
|
+
end
|
11
19
|
|
20
|
+
desc 'Alias for cucumber:ok'
|
21
|
+
task :cucumber => "cucumber:ok"
|
@@ -1,4 +1,3 @@
|
|
1
|
-
|
2
1
|
Feature: Generating a new Jenkins Ruby Plugin
|
3
2
|
|
4
3
|
Creating a new Ruby plugin for Jenkins needs to be as simple as running a single command
|
@@ -6,13 +5,10 @@ that will generate a project skeleton. This skeleton will come complete with git
|
|
6
5
|
the goodies that you need to do your plugin develompent.
|
7
6
|
|
8
7
|
Scenario: The directory skeleton is generated
|
9
|
-
When I run
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
# | Rakefile
|
17
|
-
# | newplugin.pluginspec
|
18
|
-
# """
|
8
|
+
When I run `jpi new cuke`
|
9
|
+
Then I should see this structure
|
10
|
+
"""
|
11
|
+
[-] cuke-plugin
|
12
|
+
| Gemfile
|
13
|
+
| cuke.pluginspec
|
14
|
+
"""
|
@@ -1,24 +1,25 @@
|
|
1
1
|
|
2
2
|
class DirectoryStructure
|
3
3
|
def initialize(structure)
|
4
|
-
|
5
|
-
@root = context = DirChild.new('.')
|
4
|
+
context = DirChild.new('.')
|
6
5
|
|
7
6
|
structure.each_line do |line|
|
8
|
-
if line =~
|
7
|
+
if line =~ /^(\[\-+\]|\ \|\ )\s+(.+)$/
|
9
8
|
op, name = $1, $2
|
10
|
-
case op
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
9
|
+
child = case op
|
10
|
+
when "[+]"
|
11
|
+
DirChild.new name
|
12
|
+
when "[-]"
|
13
|
+
# TODO: make to tree structure
|
14
|
+
DirChild.new name
|
15
|
+
when " | "
|
16
|
+
FileChild.new name
|
17
|
+
end
|
18
|
+
context.add child
|
20
19
|
end
|
21
20
|
end
|
21
|
+
|
22
|
+
@root = context
|
22
23
|
end
|
23
24
|
|
24
25
|
def matches?(dir)
|
@@ -28,22 +29,23 @@ class DirectoryStructure
|
|
28
29
|
Entry = Struct.new(:name)
|
29
30
|
|
30
31
|
class DirChild < Entry
|
32
|
+
attr_accessor :entries
|
33
|
+
|
31
34
|
def initialize(name)
|
32
35
|
super(name)
|
33
36
|
@entries = []
|
34
37
|
end
|
35
38
|
|
36
39
|
def add(entry)
|
37
|
-
@entries <<
|
40
|
+
@entries << entry
|
38
41
|
end
|
39
42
|
|
40
43
|
def matches?(realdir)
|
41
|
-
|
42
|
-
|
44
|
+
real_entries = Dir.glob(realdir + '/**/*').map{|e| File.basename(e) }
|
45
|
+
(@entries.map(&:name) <=> real_entries) < 1
|
43
46
|
end
|
44
47
|
end
|
45
48
|
|
46
49
|
class FileChild < Entry
|
47
|
-
|
48
50
|
end
|
49
|
-
end
|
51
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
require 'aruba/cucumber'
|
data/jpi.gemspec
CHANGED
@@ -17,13 +17,13 @@ Gem::Specification.new do |s|
|
|
17
17
|
s.executables = ['jpi']
|
18
18
|
s.require_paths = ["lib"]
|
19
19
|
|
20
|
-
s.add_dependency "
|
20
|
+
s.add_dependency "bundler"
|
21
21
|
s.add_dependency "thor"
|
22
|
-
s.add_dependency "
|
23
|
-
s.add_dependency "
|
22
|
+
s.add_dependency "rubyzip"
|
23
|
+
s.add_dependency "jenkins-war", "> 1.427"
|
24
24
|
s.add_dependency "jenkins-plugin-runtime", "~> #{Jenkins::Plugin::RUNTIME_VERSION_DEPENDENCY}"
|
25
25
|
|
26
|
-
s.add_development_dependency "rspec", "~> 2.0"
|
27
|
-
s.add_development_dependency "cucumber", "~> 1.0"
|
28
26
|
s.add_development_dependency "rake"
|
27
|
+
s.add_development_dependency "cucumber"
|
28
|
+
s.add_development_dependency "aruba"
|
29
29
|
end
|
metadata
CHANGED
@@ -1,178 +1,230 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: jpi
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.3.8
|
5
|
+
prerelease:
|
6
6
|
platform: ruby
|
7
|
-
authors:
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
autorequire:
|
7
|
+
authors:
|
8
|
+
- Charles Lowell
|
9
|
+
- Jørgen P. Tjernø
|
10
|
+
- Kohsuke Kawaguchi
|
11
|
+
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
14
|
+
date: 2012-11-14 00:00:00.000000000 Z
|
15
|
+
dependencies:
|
16
|
+
- !ruby/object:Gem::Dependency
|
17
|
+
name: bundler
|
18
|
+
version_requirements: !ruby/object:Gem::Requirement
|
19
|
+
requirements:
|
20
|
+
- - ! '>='
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: !binary |-
|
23
|
+
MA==
|
24
|
+
none: false
|
25
|
+
requirement: !ruby/object:Gem::Requirement
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: !binary |-
|
30
|
+
MA==
|
31
|
+
none: false
|
32
|
+
prerelease: false
|
33
|
+
type: :runtime
|
34
|
+
- !ruby/object:Gem::Dependency
|
35
|
+
name: thor
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ! '>='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: !binary |-
|
41
|
+
MA==
|
42
|
+
none: false
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ! '>='
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: !binary |-
|
48
|
+
MA==
|
49
|
+
none: false
|
50
|
+
prerelease: false
|
51
|
+
type: :runtime
|
52
|
+
- !ruby/object:Gem::Dependency
|
53
|
+
name: rubyzip
|
54
|
+
version_requirements: !ruby/object:Gem::Requirement
|
55
|
+
requirements:
|
56
|
+
- - ! '>='
|
57
|
+
- !ruby/object:Gem::Version
|
58
|
+
version: !binary |-
|
59
|
+
MA==
|
60
|
+
none: false
|
61
|
+
requirement: !ruby/object:Gem::Requirement
|
62
|
+
requirements:
|
63
|
+
- - ! '>='
|
64
|
+
- !ruby/object:Gem::Version
|
65
|
+
version: !binary |-
|
66
|
+
MA==
|
67
|
+
none: false
|
68
|
+
prerelease: false
|
69
|
+
type: :runtime
|
70
|
+
- !ruby/object:Gem::Dependency
|
71
|
+
name: jenkins-war
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
requirements:
|
74
|
+
- - !binary |-
|
75
|
+
Pg==
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: '1.427'
|
78
|
+
none: false
|
79
|
+
requirement: !ruby/object:Gem::Requirement
|
80
|
+
requirements:
|
81
|
+
- - !binary |-
|
82
|
+
Pg==
|
83
|
+
- !ruby/object:Gem::Version
|
84
|
+
version: '1.427'
|
85
|
+
none: false
|
86
|
+
prerelease: false
|
87
|
+
type: :runtime
|
88
|
+
- !ruby/object:Gem::Dependency
|
89
|
+
name: jenkins-plugin-runtime
|
90
|
+
version_requirements: !ruby/object:Gem::Requirement
|
91
|
+
requirements:
|
92
|
+
- - ~>
|
93
|
+
- !ruby/object:Gem::Version
|
94
|
+
version: 0.2.3
|
95
|
+
none: false
|
96
|
+
requirement: !ruby/object:Gem::Requirement
|
97
|
+
requirements:
|
98
|
+
- - ~>
|
99
|
+
- !ruby/object:Gem::Version
|
100
|
+
version: 0.2.3
|
101
|
+
none: false
|
102
|
+
prerelease: false
|
103
|
+
type: :runtime
|
104
|
+
- !ruby/object:Gem::Dependency
|
105
|
+
name: rake
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ! '>='
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: !binary |-
|
111
|
+
MA==
|
112
|
+
none: false
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ! '>='
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: !binary |-
|
118
|
+
MA==
|
119
|
+
none: false
|
120
|
+
prerelease: false
|
121
|
+
type: :development
|
122
|
+
- !ruby/object:Gem::Dependency
|
123
|
+
name: cucumber
|
124
|
+
version_requirements: !ruby/object:Gem::Requirement
|
125
|
+
requirements:
|
126
|
+
- - ! '>='
|
127
|
+
- !ruby/object:Gem::Version
|
128
|
+
version: !binary |-
|
129
|
+
MA==
|
130
|
+
none: false
|
131
|
+
requirement: !ruby/object:Gem::Requirement
|
132
|
+
requirements:
|
133
|
+
- - ! '>='
|
134
|
+
- !ruby/object:Gem::Version
|
135
|
+
version: !binary |-
|
136
|
+
MA==
|
137
|
+
none: false
|
138
|
+
prerelease: false
|
139
|
+
type: :development
|
140
|
+
- !ruby/object:Gem::Dependency
|
141
|
+
name: aruba
|
142
|
+
version_requirements: !ruby/object:Gem::Requirement
|
143
|
+
requirements:
|
144
|
+
- - ! '>='
|
145
|
+
- !ruby/object:Gem::Version
|
146
|
+
version: !binary |-
|
147
|
+
MA==
|
148
|
+
none: false
|
149
|
+
requirement: !ruby/object:Gem::Requirement
|
150
|
+
requirements:
|
151
|
+
- - ! '>='
|
152
|
+
- !ruby/object:Gem::Version
|
153
|
+
version: !binary |-
|
154
|
+
MA==
|
155
|
+
none: false
|
156
|
+
prerelease: false
|
157
|
+
type: :development
|
105
158
|
description: Allows you to generate a new Ruby plugin project, build it, test it in Jenkins and release it to the Jenkins Update Center.
|
106
|
-
email:
|
107
|
-
|
108
|
-
executables:
|
109
|
-
|
159
|
+
email:
|
160
|
+
- cowboyd@thefrontside.net
|
161
|
+
executables:
|
162
|
+
- jpi
|
110
163
|
extensions: []
|
111
|
-
|
112
164
|
extra_rdoc_files: []
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
165
|
+
files:
|
166
|
+
- Gemfile
|
167
|
+
- README.md
|
168
|
+
- Rakefile
|
169
|
+
- bin/jpi
|
170
|
+
- features/create-new-plugin.feature
|
171
|
+
- features/step_definitions/new_steps.rb
|
172
|
+
- features/support/directory_structure.rb
|
173
|
+
- features/support/env.rb
|
174
|
+
- features/support/workdir.rb
|
175
|
+
- jpi.gemspec
|
176
|
+
- lib/jenkins/jenkins-ci.org/credential.rb
|
177
|
+
- lib/jenkins/plugin/cli.rb
|
178
|
+
- lib/jenkins/plugin/cli/formatting.rb
|
179
|
+
- lib/jenkins/plugin/cli/generate.rb
|
180
|
+
- lib/jenkins/plugin/cli/new.rb
|
181
|
+
- lib/jenkins/plugin/cli/templates/Gemfile.tt
|
182
|
+
- lib/jenkins/plugin/cli/templates/build_step.tt
|
183
|
+
- lib/jenkins/plugin/cli/templates/build_wrapper.tt
|
184
|
+
- lib/jenkins/plugin/cli/templates/computer_listener.tt
|
185
|
+
- lib/jenkins/plugin/cli/templates/node_property.tt
|
186
|
+
- lib/jenkins/plugin/cli/templates/pluginspec.tt
|
187
|
+
- lib/jenkins/plugin/cli/templates/run_listener.tt
|
188
|
+
- lib/jenkins/plugin/tools/bundle.rb
|
189
|
+
- lib/jenkins/plugin/tools/hpi.rb
|
190
|
+
- lib/jenkins/plugin/tools/loadpath.rb
|
191
|
+
- lib/jenkins/plugin/tools/manifest.rb
|
192
|
+
- lib/jenkins/plugin/tools/package.rb
|
193
|
+
- lib/jenkins/plugin/tools/release.rb
|
194
|
+
- lib/jenkins/plugin/tools/resolver.rb
|
195
|
+
- lib/jenkins/plugin/tools/server.rb
|
196
|
+
- lib/jenkins/plugin/tools/templates/release-pom.xml.erb
|
197
|
+
- lib/jenkins/plugin/version.rb
|
198
|
+
- lib/jenkins/rake.rb
|
147
199
|
homepage: https://github.com/jenkinsci/jenkins.rb/tree/master/ruby-tools/jpi
|
148
200
|
licenses: []
|
149
|
-
|
150
|
-
post_install_message:
|
201
|
+
post_install_message:
|
151
202
|
rdoc_options: []
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
203
|
+
require_paths:
|
204
|
+
- lib
|
205
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
206
|
+
requirements:
|
207
|
+
- - ! '>='
|
208
|
+
- !ruby/object:Gem::Version
|
209
|
+
version: !binary |-
|
210
|
+
MA==
|
156
211
|
none: false
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
212
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
213
|
+
requirements:
|
214
|
+
- - ! '>='
|
215
|
+
- !ruby/object:Gem::Version
|
216
|
+
version: !binary |-
|
217
|
+
MA==
|
162
218
|
none: false
|
163
|
-
requirements:
|
164
|
-
- - ">="
|
165
|
-
- !ruby/object:Gem::Version
|
166
|
-
version: "0"
|
167
219
|
requirements: []
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
signing_key:
|
220
|
+
rubyforge_project:
|
221
|
+
rubygems_version: 1.8.24
|
222
|
+
signing_key:
|
172
223
|
specification_version: 3
|
173
224
|
summary: Tools for creating and building Jenkins Ruby plugins
|
174
|
-
test_files:
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
225
|
+
test_files:
|
226
|
+
- features/create-new-plugin.feature
|
227
|
+
- features/step_definitions/new_steps.rb
|
228
|
+
- features/support/directory_structure.rb
|
229
|
+
- features/support/env.rb
|
230
|
+
- features/support/workdir.rb
|
data/features/support/work.rb
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
module Work
|
2
|
-
def run cmd
|
3
|
-
Dir.chdir(work_dir) do
|
4
|
-
root = Pathname(__FILE__).join('..', '..', '..')
|
5
|
-
full_cmd = "ruby -rubygems -I #{root.join('lib')} -S #{root.join('bin',cmd)}"
|
6
|
-
system(full_cmd) or fail "failed to run command #{cmd}"
|
7
|
-
end
|
8
|
-
end
|
9
|
-
|
10
|
-
def work_dir
|
11
|
-
@work_dir ||= File.expand_path("tmp/work")
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
|
-
Before do
|
16
|
-
FileUtils.rm_rf work_dir
|
17
|
-
FileUtils.mkdir_p work_dir
|
18
|
-
end
|
19
|
-
|
20
|
-
World(Work)
|