Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 53 lines (43 sloc) 1.884 kB
7a2052c fixes #92
toshiyuki.ando1971 authored
1 # $Id$
732af37 refs #267
toshiyuki.ando1971 authored
2 require 'dispatcher'
9b15af1 refs #36
toshiyuki.ando1971 authored
3 require 'redmine'
d0a1436 refs #51
toshiyuki.ando1971 authored
4 require 'hudson_application_hooks'
732af37 refs #267
toshiyuki.ando1971 authored
5 require 'query_patch'
9b15af1 refs #36
toshiyuki.ando1971 authored
6
7 Redmine::Plugin.register :redmine_hudson do
8 name 'Redmine Hudson plugin'
697813d refs #36
toshiyuki.ando1971 authored
9 author 'Toshiyuki Ando r-labs'
10 url "http://www.r-labs.org/repositories/show/hudson" if respond_to?(:url)
9b15af1 refs #36
toshiyuki.ando1971 authored
11 description 'This is a Hudson plugin for Redmine'
c176d2c refs #414
toshiyuki.ando1971 authored
12 version '1.0.5'
697813d refs #36
toshiyuki.ando1971 authored
13 requires_redmine :version_or_higher => '0.8.0'
9b15af1 refs #36
toshiyuki.ando1971 authored
14
15 project_module :hudson do
16 # パーミッション設定。
130ca75 refs #51
toshiyuki.ando1971 authored
17 permission :view_hudson, {:hudson => [:index, :history]}
18 permission :build_hudson, {:hudson => [:build]}, :require => :member
681fd67 refs #266
toshiyuki.ando1971 authored
19 permission :edit_hudson_settings, {:hudson_settings => [:edit, :joblist, :delete_builds, :delete_history]}, :require => :member
9b15af1 refs #36
toshiyuki.ando1971 authored
20 end
21
22 menu :project_menu, :hudson, { :controller => :hudson, :action => :index }, :param => :id, :caption => :label_hudson
23
130ca75 refs #51
toshiyuki.ando1971 authored
24 activity_provider :hudson, :class_name => 'HudsonBuild', :default => false
25
b211d1f refs #142
toshiyuki.ando1971 authored
26 settings(:default => {
dbf05fa fixes #190
toshiyuki.ando1971 authored
27 'autofetch' => "true",
bde2943 fixes #267
toshiyuki.ando1971 authored
28 'job_description_format' => "hudson",
29 'query_limit_builds_each_job' => 100,
30 'query_limit_changesets_each_job' => 100
b211d1f refs #142
toshiyuki.ando1971 authored
31 },
32 :partial => 'hudson_settings/redmine_hudson_settings')
33
bce913f refs #87
toshiyuki.ando1971 authored
34 Redmine::WikiFormatting::Macros.register do
35 desc "This is my macro link to hudson"
36 macro :build do |obj, args|
37 return nil if args.length < 2 # require JobName, BuildNumber
38 return nil if @project == nil
9aa72ce refs #142
toshiyuki.ando1971 authored
39 hudson = Hudson.find_by_project_id(@project.id)
40 return nil if hudson == nil
bce913f refs #87
toshiyuki.ando1971 authored
41 name = args[0].strip
42 number = args[1].strip
9aa72ce refs #142
toshiyuki.ando1971 authored
43 return link_to "Build:#{name} ##{number}", URI.escape("#{hudson.settings.url}job/#{name}/#{number}/")
bce913f refs #87
toshiyuki.ando1971 authored
44 end
45 end
46
9b15af1 refs #36
toshiyuki.ando1971 authored
47 end
732af37 refs #267
toshiyuki.ando1971 authored
48
49 Dispatcher.to_prepare do
40c19f4 refs #267
toshiyuki.ando1971 authored
50 Query.send( :include, RedmineHudson::RedmineExt::QueryPatch)
732af37 refs #267
toshiyuki.ando1971 authored
51 end
52
Something went wrong with that request. Please try again.