require "FileTransferViaFTP"
require "FileTransferViaDirect"
require "JobLog"
+require "BuildServerException"
#option parsing
raise RuntimeError, "The output file is already exist."
end
log = File.open(output, "w")
+ puts "Started query log, writing to the file \"#{output}\""
end
result = JobLog.monitor(addr[0], addr[1], option[:job].strip) do |line|
end
if result and not output.nil? then
log.puts "=LOG_END"
+ puts "End query log, check file \"#{output}\""
end
rescue BuildServerException => e
log.puts e.err_message()
#PRE-EXEC
echo "query-log"
-../../build-cli query-log -d 127.0.0.1:2223 -j 1 --output a.txt
+rm -rf a.txt
#EXEC
-cat a.txt | grep {2} | cut -d '}' -f2
+../../build-cli query-log -d 127.0.0.1:2223 -j 1 --output a.txt
#POST-EXEC
rm -rf a.txt
#EXPECT
-Added new job
-Initializing job...
-Checking package version ...
-Invoking a thread for building Job
-New Job
-hecking build dependency ...
-Checking install dependency ...
-Started to build this job...
-JobBuilder
-ownloding client is initializing...
-Installing dependent packages...
-Downloading dependent source packages...
-Make clean...
-Make build...
-Make install...
-eneratiing pkginfo.manifest...
-Zipping...
-Creating package file ... a_0.0.1_ubuntu-32.zip
-Checking reverse build dependency ...
-Uploading ...
-Upload succeeded. Sync local pkg-server again...
-Snapshot:
-Job is completed!
-Job is FINISHED successfully!
-Updating the source info for project "testa"
-=LOG_END
+Started query log, writing to the file "a.txt"
+End query log, check file "a.txt"