forked from benhoskings/babushka-deps
-
Notifications
You must be signed in to change notification settings - Fork 0
/
hudson.rb
57 lines (51 loc) · 1.1 KB
/
hudson.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
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
dep 'hudson' do
requires [
'installed.hudson',
'cli.hudson',
'git.hpi', 'github.hpi', 'ruby.hpi', 'rake.hpi'
]
end
meta :hudson do
def path
'~/hudson'.p
end
end
dep 'installed.hudson' do
requires 'tomcat.managed'
met? { (path / 'hudson.war').exists? }
meet {
cd path, :create => true do
shell 'wget http://hudson-ci.org/latest/hudson.war'
end
}
end
dep 'cli.hudson' do
met? { (path / 'hudson-cli.jar').exists? }
meet {
cd path, :create => true do
shell 'jar -xf hudson.war WEB-INF/hudson-cli.jar'
shell 'mv WEB-INF/hudson-cli.jar .'
shell 'rmdir WEB-INF'
end
}
end
meta :hpi do
accepts_value_for :source, :name
template {
met? {
"~/.hudson/plugins/#{source}".p.exists?
}
meet {
Babushka::Resource.get "http://hudson-ci.org/latest/#{source}" do |hpi|
shell "java -jar ~/hudson/hudson-cli.jar -s http://localhost:8080/ install-plugin #{hpi}"
end
}
}
end
dep 'tomcat.managed' do
provides %w[catalina.sh startup.sh shutdown.sh]
end
dep 'git.hpi'
dep 'github.hpi'
dep 'ruby.hpi'
dep 'rake.hpi'