Skip to content

Instantly share code, notes, and snippets.

@cynipe
Created June 6, 2012 04:31
Show Gist options
  • Save cynipe/2879941 to your computer and use it in GitHub Desktop.
Save cynipe/2879941 to your computer and use it in GitHub Desktop.
cynipeと読む:Jenkins第一回Rubyプラグイン開発Hackathon開催されるよー!
class HelloPublisher < Jenkins::Tasks::Publisher
display_name "Hello publisher"
# Invoked with the form parameters when this extension point
# is created from a configuration screen.
def initialize(attrs = {})
end
##
# Runs before the build begins
#
# @param [Jenkins::Model::Build] build the build which will begin
# @param [Jenkins::Model::Listener] listener the listener for this build.
def prebuild(build, listener)
# do any setup that needs to be done before this build runs.
end
##
# Runs the step over the given build and reports the progress to the listener.
#
# @param [Jenkins::Model::Build] build on which to run this step
# @param [Jenkins::Launcher] launcher the launcher that can run code on the node running this build
# @param [Jenkins::Model::Listener] listener the listener for this build.
def perform(build, launcher, listener)
listener.info "Hello Jenkins.rb!!"
end
end
$ gem install jpi
$ jpi --help
jpi - tools to create, build, develop and release Jenkins plugins
Usage: jpi command [arguments] [options]
Commands:
jpi help [COMMAND] # get help for COMMAND, or for jpi itself
jpi new NAME # create a new plugin called NAME
jpi generate [options] [arguments] # add new classes/templates and views t...
jpi build # build plugin into .hpi file suitable ...
jpi server # run a test server with plugin
jpi release # release to jenkins-ci.org
jpi version # show jpi version information
# プロジェクトの作成
$ jpi new hello
create hello-plugin/Gemfile
create hello-plugin/hello.pluginspec
$ cd hello-plugin
# Publisherの生成
$ jpi generate publisher hello
create models/hello_publisher.rb
$ vim models/hello_publisher.rb
# RVMのインストール
$ curl -L get.rvm.io | bash -s stable --ruby
# JRubyのインストール
$ rvm install jruby
# Jenkinsプラグイン開発専用の環境を用意
$ rvm use --create jruby@jenkins
@madper
Copy link

madper commented Jun 28, 2013

Hi! I want to add a views also. is there a jpi command for creating a views folder? or should I create it manually? thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment