Now it works as a cronjob, yay
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@2391 51baf565-9d33-0410-a72c-fc3788e3496d
This commit is contained in:
@ -3,28 +3,30 @@
|
||||
require '/home/tom/data/pmd/pmd-web/src/pmd.rb'
|
||||
|
||||
Dir.chdir(PMD::Job::ROOT)
|
||||
ENV['JAVA_HOME']="/usr/local/java"
|
||||
ENV['PATH']="#{ENV['PATH']}:#{ENV['JAVA_HOME']}/bin"
|
||||
|
||||
Dir.new("jobs").each { |candidate|
|
||||
begin
|
||||
if candidate[".txt"]
|
||||
location,title,unixname,moduleDir,srcDir = File.new("jobs/#{candidate}").read.split(":")
|
||||
if ARGV.length != 0 && ARGV[0] != moduleDir
|
||||
next
|
||||
end
|
||||
job = PMD::Job.new(location,title,unixname,moduleDir,srcDir)
|
||||
puts "Processing #{job}"
|
||||
job.clear
|
||||
job.checkout_code
|
||||
if job.checkOutOK
|
||||
job.run_pmd
|
||||
job.run_cpd
|
||||
job.ncss
|
||||
`echo #{Time.now} > lastruntime.txt`
|
||||
job.copy_up
|
||||
job.clear
|
||||
end
|
||||
end
|
||||
rescue
|
||||
puts "Exiting with error: #{$!}"
|
||||
end
|
||||
begin
|
||||
if candidate[".txt"]
|
||||
location,title,unixname,moduleDir,srcDir = File.new("jobs/#{candidate}").read.split(":")
|
||||
if ARGV.length != 0 && ARGV[0] != moduleDir
|
||||
next
|
||||
end
|
||||
job = PMD::Job.new(location,title,unixname,moduleDir,srcDir)
|
||||
puts "Processing #{job}"
|
||||
job.clear
|
||||
job.checkout_code
|
||||
if job.checkOutOK
|
||||
job.run_pmd
|
||||
job.run_cpd
|
||||
job.ncss
|
||||
`echo #{Time.now} > lastruntime.txt`
|
||||
job.copy_up
|
||||
job.clear
|
||||
end
|
||||
end
|
||||
rescue
|
||||
puts "Exiting with error: #{$!}"
|
||||
end
|
||||
}
|
||||
|
Reference in New Issue
Block a user