File: Rakefile

package info (click to toggle)
debci 0.10.3
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 904 kB
  • ctags: 310
  • sloc: sh: 1,662; ruby: 1,007; makefile: 35
file content (33 lines) | stat: -rw-r--r-- 846 bytes parent folder | download | duplicates (3)
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
require 'json'

task :default do
  system('rake', '-T')
end

desc 'prints failing packages (default)'
task :failing => 'failing.json' do
  failing = JSON.load(File.read('failing.json'))
  failing.sort_by { |entry| -Integer(entry['duration_seconds']) }.each do |entry|
    puts "%-50s %10ds" % [entry['package'], entry['duration_seconds']]
  end
end

file 'failing.json' => ['packages.json'] do |task|
  packages = JSON.load(File.read('packages.json'))
  data = packages.select { |p| p['status'] == 'fail' }
  File.open(task.name, 'w') { |f| f.write(JSON.pretty_generate(data)) }
end

file 'packages.json' do
  sh 'wget', 'http://ci.debian.net/data/status/unstable/amd64/packages.json'
end

desc 'clean'
task :clean do
  rm_f 'failing.json'
end

desc 'clean everything including downloads'
task 'fullclean' => :clean do
  rm_f 'packages.json'
end