pkg-wizard 0.1.16 → 0.1.17
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/pkg-wizard/commands/build_bot.rb +16 -2
- data/lib/pkg-wizard/commands/init_env.rb +2 -2
- data/lib/pkg-wizard.rb +1 -1
- metadata +4 -4
@@ -76,7 +76,11 @@ module PKGWizard
|
|
76
76
|
# list failed pkgs
|
77
77
|
get '/job/failed' do
|
78
78
|
max = params[:max] || 10
|
79
|
+
# Find failed jobs
|
79
80
|
jobs = (Dir["failed/job_*"].sort { |a,b| a <=> b }).map { |j| File.basename(j) }
|
81
|
+
|
82
|
+
# format job as job_XXXX_XXX (pkgname)
|
83
|
+
jobs = jobs.map { |j| "#{j} (#{File.basename(Dir["failed/#{j}/*.src.rpm"].first(), '.src.rpm')})" }
|
80
84
|
max = max.to_i
|
81
85
|
if jobs.size > max.to_i
|
82
86
|
jobs[- max..-1].to_yaml
|
@@ -109,7 +113,7 @@ module PKGWizard
|
|
109
113
|
}.to_yaml
|
110
114
|
end
|
111
115
|
|
112
|
-
# list
|
116
|
+
# list successfully built pkgs
|
113
117
|
get '/job/successful' do
|
114
118
|
max = params[:max] || 10
|
115
119
|
jobs = (Dir["output/job_*"].sort { |a,b| a <=> b }).map { |j| File.basename(j) }
|
@@ -121,7 +125,10 @@ module PKGWizard
|
|
121
125
|
end
|
122
126
|
end
|
123
127
|
|
124
|
-
|
128
|
+
#
|
129
|
+
# Rebuild a previous job (It can be either successful or failed build)
|
130
|
+
#
|
131
|
+
post '/job/rebuild/:name' do
|
125
132
|
name = params[:name]
|
126
133
|
job = find_job_path(name)
|
127
134
|
if job.nil?
|
@@ -129,9 +136,11 @@ module PKGWizard
|
|
129
136
|
else
|
130
137
|
$stdout.puts "Rebuilding job [#{name}]".ljust(40) + File.basename(Dir["#{job}/*.rpm"].first)
|
131
138
|
FileUtils.cp Dir["#{job}/*.rpm"].first, 'incoming/'
|
139
|
+
FileUtils.rm_rf job
|
132
140
|
end
|
133
141
|
end
|
134
142
|
|
143
|
+
# Get current building job (empty output if none)
|
135
144
|
get '/job/current' do
|
136
145
|
job = Dir['workspace/job*'].first
|
137
146
|
if job
|
@@ -141,6 +150,8 @@ module PKGWizard
|
|
141
150
|
end
|
142
151
|
end
|
143
152
|
|
153
|
+
|
154
|
+
# Get job info
|
144
155
|
get '/job/:name' do
|
145
156
|
jname = params[:name]
|
146
157
|
jobs = Dir['output/job_*'] + Dir['failed/job_*']
|
@@ -202,6 +213,7 @@ module PKGWizard
|
|
202
213
|
FileUtils.rm_rf d
|
203
214
|
end
|
204
215
|
FileUtils.rm 'failed/.clean'
|
216
|
+
FileUtils.rm_rf "failed/last"
|
205
217
|
end
|
206
218
|
if File.exist?('output/.clean')
|
207
219
|
$stdout.puts '* cleaning OUTPUT jobs'
|
@@ -209,6 +221,8 @@ module PKGWizard
|
|
209
221
|
FileUtils.rm_rf d
|
210
222
|
end
|
211
223
|
FileUtils.rm 'output/.clean'
|
224
|
+
FileUtils.rm_rf 'output/repodata'
|
225
|
+
FileUtils.rm_rf 'output/last'
|
212
226
|
end
|
213
227
|
end
|
214
228
|
|
@@ -30,7 +30,7 @@ module PKGWizard
|
|
30
30
|
end
|
31
31
|
if File.exist?('/etc/redhat-release')
|
32
32
|
print '* Installing RHEL/Fedora requirements... '
|
33
|
-
output = `yum install -y git rpmdevtools mock createrepo yum-utils`
|
33
|
+
output = `yum install -y git rpmdevtools mock createrepo yum-utils screen`
|
34
34
|
if $? != 0
|
35
35
|
$stderr.puts "Failed installing requirementes: \n#{output}"
|
36
36
|
exit 1
|
@@ -39,7 +39,7 @@ module PKGWizard
|
|
39
39
|
elsif File.exist?('/etc/lsb-release') and \
|
40
40
|
File.read('/etc/lsb-release') =~ /DISTRIB_ID=Ubuntu/
|
41
41
|
print '* Installing Ubuntu requirements... '
|
42
|
-
output = `apt-get install -y git-core mock createrepo rpm yum`
|
42
|
+
output = `apt-get install -y git-core mock createrepo rpm yum screen`
|
43
43
|
if $? != 0
|
44
44
|
$stderr.puts "Failed installing requirementes: \n#{output}"
|
45
45
|
exit 1
|
data/lib/pkg-wizard.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pkg-wizard
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 57
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 17
|
10
|
+
version: 0.1.17
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Sergio Rubio
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-
|
18
|
+
date: 2011-04-01 00:00:00 +02:00
|
19
19
|
default_executable: pkgwiz
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|