jenkins-plugin 0.1.7 → 0.1.8

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -26,8 +26,16 @@ The gem provides the `jpi` executeable
26
26
  jpi server # run a test server with plugin
27
27
  jpi version # show jpi version information
28
28
 
29
- Once you have a plugin project, you can run a Jenkins test server like so:
29
+ The first thing you'll probably want to do is create a new ruby plugin.
30
30
 
31
+ $ jpi new one-great-plugin
32
+ create one-great-plugin/Gemfile
33
+ create one-great-plugin/one-great-plugin.pluginspec
34
+
35
+ This will create a minimal plugin project structure, to which you can add later.
36
+ Once you have your plugin created, you can run a server with it loaded
37
+
38
+ $ cd one-great-plugin
31
39
  $ jpi server
32
40
 
33
41
  Listening for transport dt_socket at address: 8000
@@ -43,9 +51,6 @@ Once you have a plugin project, you can run a Jenkins test server like so:
43
51
  INFO: Listed all plugins
44
52
  Sep 19, 2011 12:01:39 PM ruby.RubyRuntimePlugin start
45
53
  INFO: Injecting JRuby into XStream
46
- Loading models/builder.rb
47
- Loading logging_wrapper.rb
48
- Loading root_action.rb
49
54
  Sep 19, 2011 12:01:49 PM jenkins.model.Jenkins$6 onAttained
50
55
  INFO: Prepared all plugins
51
56
  Sep 19, 2011 12:01:49 PM jenkins.model.Jenkins$6 onAttained
@@ -61,5 +66,11 @@ Once you have a plugin project, you can run a Jenkins test server like so:
61
66
  Sep 19, 2011 12:02:01 PM hudson.WebAppMain$2 run
62
67
  INFO: Jenkins is fully up and running
63
68
 
69
+ Of course, this plugin isn't actually doing anything because we haven't defined any extension
70
+ points. Let's go ahead and create one of the most common extension points: a `Builder`
71
+
72
+ $ jpi generate builder logging
73
+ TODO: implement generators
74
+
64
75
 
65
76
 
@@ -37,7 +37,7 @@ module Jenkins
37
37
  list = printable_tasks
38
38
  print shell.set_color("jpi", :black, true)
39
39
  shell.say <<-USEAGE
40
- - tools to create, build, develop and release Jenkins plugins
40
+ - tools to create, build, develop and release Jenkins plugins
41
41
 
42
42
  Usage: jpi command [arguments] [options]
43
43
 
@@ -0,0 +1,25 @@
1
+
2
+ require 'thor/group'
3
+
4
+ module Jenkins
5
+ class Plugin
6
+ class CLI
7
+ class New < Thor::Group
8
+ include Thor::Actions
9
+
10
+ source_root File.dirname(__FILE__)
11
+
12
+ argument :name
13
+
14
+ def create_gemfile
15
+ template('templates/Gemfile.tt', "#{name}/Gemfile")
16
+ end
17
+
18
+ def create_pluginspec
19
+ template('templates/pluginspec.tt', "#{name}/#{name}.pluginspec")
20
+ end
21
+
22
+ end
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,4 @@
1
+
2
+ source :rubygems
3
+
4
+ gem "jenkins-plugin-runtime", "~> 0.1.5"
@@ -0,0 +1,8 @@
1
+
2
+ Jenkins::Plugin::Specification.new do |plugin|
3
+ plugin.name = '<%= name %>'
4
+ plugin.version = '0.0.1'
5
+ plugin.description = 'enter description here'
6
+
7
+ plugin.depends_on 'ruby-runtime', '0.3'
8
+ end
@@ -2,6 +2,7 @@
2
2
  require 'thor'
3
3
  require 'jenkins/plugin/specification'
4
4
  require 'jenkins/plugin/cli/formatting'
5
+ require 'jenkins/plugin/cli/new'
5
6
 
6
7
 
7
8
  module Jenkins
@@ -9,10 +10,7 @@ module Jenkins
9
10
  class CLI < Thor
10
11
  extend Formatting
11
12
 
12
- desc "new NAME", "create a new plugin called NAME"
13
- def new(name)
14
- shell.say "TODO: new(#{name})"
15
- end
13
+ register New, "new", "new NAME", "create a new plugin called NAME"
16
14
 
17
15
  desc "generate", "generate code for extensions points"
18
16
  def generate
@@ -35,7 +35,7 @@ module Jenkins
35
35
  io.puts "Lib-Path: #{Dir.pwd}/lib/"
36
36
  io.puts "Models-Path: #{Dir.pwd}/models"
37
37
  # Stapler expects view erb/haml scripts to be in the JVM ClassPath
38
- io.puts "Class-Path: #{Dir.pwd}/views"
38
+ io.puts "Class-Path: #{Dir.pwd}/views" if File.exists?("#{Dir.pwd}/views")
39
39
  # Directory for static images, javascript, css, etc. of this plugin.
40
40
  # The static resources are mapped under #CONTEXTPATH/plugin/SHORTNAME/
41
41
  io.puts "Resource-Path: #{Dir.pwd}/static"
@@ -1,5 +1,5 @@
1
1
  module Jenkins
2
2
  class Plugin
3
- VERSION = "0.1.7"
3
+ VERSION = "0.1.8"
4
4
  end
5
5
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: jenkins-plugin
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.1.7
5
+ version: 0.1.8
6
6
  platform: ruby
7
7
  authors:
8
8
  - Charles Lowell
@@ -109,6 +109,9 @@ files:
109
109
  - jenkins-plugin.gemspec
110
110
  - lib/jenkins/plugin/cli.rb
111
111
  - lib/jenkins/plugin/cli/formatting.rb
112
+ - lib/jenkins/plugin/cli/new.rb
113
+ - lib/jenkins/plugin/cli/templates/Gemfile.tt
114
+ - lib/jenkins/plugin/cli/templates/pluginspec.tt
112
115
  - lib/jenkins/plugin/tools/hpi.rb
113
116
  - lib/jenkins/plugin/tools/loadpath.rb
114
117
  - lib/jenkins/plugin/tools/manifest.rb