#import koji
#from kojiweb import util
#import urllib
#import cgi
#def printValue($key, $value, $sep=', ')
#if $key in ('brootid', 'buildroot_id')
$value
#elif $isinstance($value, list)
$sep.join([$str($val) for $val in $value])
#elif $isinstance($value, dict)
$sep.join(['%s=%s' % (($n == '' and "''" or $n), $v) for $n, $v in $value.items()])
#else
$value
#end if
#end def
#def printProperties($props)
#echo ', '.join([$v is not None and '%s=%s' % ($n, $v) or $str($n) for $n, $v in $props.items()])
#end def
#def printMap($vals, $prefix='')
#for $key, $value in $vals.items()
#if $key == 'properties'
${prefix}properties = $printProperties($value)
#elif $key != '__starstar'
$prefix$key = $printValue($key, $value)
#end if
#end for
#end def
#def printOpts($opts)
#if $opts
Options:
$printMap($opts, ' ')
#end if
#end def
#def printChildren($taskID, $childMap)
#set $iter = 0
#set $children = $childMap[$str($taskID)]
#if $children
ID | $task.id | ||
---|---|---|---|
Method | $task.method | ||
Parameters |
#if $task.method == 'buildSRPMFromSCM'
SCM URL: $params[0] #if $len($params) > 1 Build Tag:: $buildTag.name #end if #if $len($params) > 2 $printOpts($params[2]) #end if #elif $task.method == 'buildSRPMFromCVS' CVS URL: $params[0] #elif $task.method == 'buildArch' SRPM: $params[0] Build Tag: $buildTag.name Arch: $params[2] Keep SRPM? #if $params[3] then 'yes' else 'no'# #if $len($params) > 4 $printOpts($params[4]) #end if #elif $task.method == 'tagBuild' Destination Tag: $destTag.name Build: $koji.buildLabel($build) #elif $task.method == 'buildNotification' #set $build = $params[1] #set $buildTarget = $params[2] Recipients: $printValue('', $params[0]) Build: $koji.buildLabel($build) #if $buildTarget Build Target: $buildTarget.name #else Build Target: (no build target) #end if Web URL: $params[3] #elif $task.method == 'tagNotification' Recipients: $printValue('', $params[0]) Successful?: #if $params[1] then 'yes' else 'no'# #if $destTag Tagged Into: $destTag.name #end if #if $srcTag #if $destTag then 'Moved From:' else 'Untagged From:'# $srcTag.name #end if Build: $koji.buildLabel($build) #if $destTag then 'Tagged By:' else 'Untagged By:'# $user.name Ignore Success?: #if $params[6] then 'yes' else 'no'# #if $params[7] Failure Message: $params[7] #end if #elif $task.method == 'build' Source: $params[0] Build Target: $params[1] $printOpts($params[2]) #elif $task.method == 'maven' SCM URL: $params[0] Build Target: $params[1] $printOpts($params[2]) #elif $task.method == 'buildMaven' SCM URL: $params[0] Build Tag: $buildTag.name #if $len($params) > 2 $printOpts($params[2]) #end if #elif $task.method == 'wrapperRPM' Spec File URL: $params[0] #if 'locked' in $buildTarget #set $buildTag = $buildTarget Build Tag: $buildTag.name #else Build Target: $buildTarget.name #end if #if $params[2] Build: $koji.buildLabel($params[2]) #end if #if $params[3] Task: $koji.taskLabel($wrapTask) #end if #if $len($params) > 4 $printOpts($params[4]) #end if #elif $task.method == 'chainmaven' Builds:
#if $len($params) > 2 $printOpts($params[2]) #end if #elif $task.method == 'livecd' or $task.method == 'appliance' or $task.method == 'livemedia' Name: $params[0] Version: $params[1] Arch: $params[2] Build Target: $params[3] Kickstart File: $params[4] $printOpts($params[5]) #elif $task.method == 'image' Arches: #echo ', '.join($params[2])# Build Target: $params[3] Installation Tree: $params[4] $printOpts($params[5]) #elif $task.method == 'createLiveCD' or $task.method == 'createAppliance' or $task.method == 'createLiveMedia' #if $len($params) > 4: ## new method signature Arch: $params[3] Kickstart File: $params[7] #if $len($params) > 8 $printOpts($params[8]) #end if #else ## old method signature Arch: $params[0] Build Target: $params[1] Kickstart File: $params[2] #if $len($params) > 3 $printOpts($params[3]) #end if #end if #elif $task.method == 'createImage' #set $target = $params[4] Build Target: $target.name Install Tree: $params[7] $printOpts($params[8]) #elif $task.method == 'winbuild' VM: $params[0] SCM URL: $params[1] Build Target: $params[2] #if $len($params) > 3 $printOpts($params[3]) #end if #elif $task.method == 'vmExec' VM: $params[0] Exec Params: #for $info in $params[1] #if $isinstance($info, dict) $printMap($info, ' ') #else $info #end if #end for #if $len($params) > 2 $printOpts($params[2]) #end if #elif $task.method == 'newRepo' Tag: $tag.name #if $len($params) > 1 $printOpts($params[1]) #end if #elif $task.method == 'distRepo' Tag: $tag.name Repo ID: $params[1] Keys: $printValue(0, $params[2]) $printOpts($params[3]) #elif $task.method == 'prepRepo' Tag: $params[0].name #elif $task.method == 'createrepo' Repo ID: $params[0] Arch: $params[1] #set $oldrepo = $params[2] #if $oldrepo Old Repo ID: $oldrepo.id Old Repo Creation: $koji.formatTimeLong($oldrepo.creation_time) #end if #if $len($params) > 4 and $params[4] External Repos: $printValue(None, [ext['external_repo_name'] for ext in $params[3]]) #end if #elif $task.method == 'createdistrepo' Tag: $tag.name Repo ID: $params[1] Arch: $printValue(0, $params[2]) Keys: $printValue(0, $params[3]) Options: $printMap($params[4], ' ') #elif $task.method == 'dependantTask' Dependant Tasks: #for $dep in $deps $koji.taskLabel($dep) #end for Subtasks: #for $subtask in $params[1] Method: $subtask[0] Parameters: #echo ', '.join([$str($subparam) for $subparam in $subtask[1]])# #if $len($subtask) > 2 and $subtask[2] Options: $printMap($subtask[2], ' ') #end if #end for #elif $task.method == 'chainbuild' Build Groups: #set $groupNum = 0 #for $urls in $params[0] #set $groupNum += 1 $groupNum: #echo ', '.join($urls)# #end for Build Target: $params[1] $printOpts($params[2]) #elif $task.method == 'waitrepo' Build Target: $params[0] #if $params[1] Newer Than: $params[1] #end if #if $params[2] NVRs: $printValue('', $params[2]) #end if #elif $task.method == 'restart' Host: $params[0].name #elif $task.method == 'restartVerify' Host: $params[1].name Restart Task: $koji.taskLabel($rtask) #elif $task.method == 'runroot' Build Tag: $params[0] Arch: $params[1] $printOpts($params[3]) Commands: $params[2] #else $params #end if |
||
State | $state #if $currentUser and ('admin' in $perms or $task.owner == $currentUser.id) #if $task.state in ($koji.TASK_STATES.FREE, $koji.TASK_STATES.OPEN, $koji.TASK_STATES.ASSIGNED) (cancel) #elif $task.state in ($koji.TASK_STATES.CANCELED, $koji.TASK_STATES.FAILED) and (not $parent) (resubmit) #end if #end if | ||
Build | $koji.buildLabel($taskBuild) | ||
Created | $util.formatTimeLong($task.create_time) | ||
Started | $util.formatTimeLong($task.start_time) | #end if #if $task.state == $koji.TASK_STATES.OPEN #if $estCompletion||
Est. Completion | $util.formatTimeLong($estCompletion) | ||
Completed | $util.formatTimeLong($task.completion_time) | ||
Owner | #if $owner #if $owner.usertype == $koji.USERTYPES['HOST'] $owner.name #else $owner.name #end if #end if | ||
Channel | #if $task.channel_id $channelName #end if | ||
Host | #if $task.host_id $hostName #end if | ||
Arch | $task.arch | ||
Buildroot#if $len($buildroots) > 1 then 's' else ''# |
#for $buildroot in $buildroots
#if $task.method == 'vmExec' then '' else '/var/lib/mock/'#$buildroot.tag_name-$buildroot.id-$buildroot.repo_id #end for |
||
Parent | #if $parent $koji.taskLabel($parent) #end if | ||
Descendants | #if $len($descendents[$str($task.id)]) > 0 $task.method #end if $printChildren($task.id, $descendents) | ||
Waiting? | #if $task.waiting then 'yes' else 'no'# | ||
Awaited? | #if $task.awaited then 'yes' else 'no'# | ||
Priority | $task.priority | ||
Weight | #echo '%.2f' % $task.weight# | ||
Result |
#if $abbr_result_text
$abbr_result_text
$full_result_text
#else
$full_result_text
#end if
|
||
Output |
#for $volume, $filename in $output
$filename
#if $filename.endswith('.log')
(tail)
#end if
#end for #if $task.state not in ($koji.TASK_STATES.CLOSED, $koji.TASK_STATES.CANCELED, $koji.TASK_STATES.FAILED) and \ $task.method in ('buildSRPMFromSCM', 'buildArch', 'createLiveMedia', 'buildMaven', 'wrapperRPM', 'vmExec', 'createrepo', 'runroot', 'createAppliance', 'createLiveCD') Watch logs #end if |