Rev 7261 | Rev 7286 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed
<%@LANGUAGE="VBSCRIPT"%><%'====================================================='' _iframe_build_logs.asp' This page is designed to be called from within an IFRAME'' Locate log files for a specific build''=====================================================%><%Option explicit' Good idea to set when using redirectResponse.Expires = 0 ' always load the page, dont store%><!--#include file="common/conf.asp"--><!--#include file="common/globals.asp"--><!--#include file="common/formating.asp"--><!--#include file="common/qstr.asp"--><!--#include file="common/common_subs.asp"--><!--#include file="common/_form_window_common.asp"--><%'------------ ACCESS CONTROL ------------------%><!--#include file="_access_control_general.asp"--><SCRIPT LANGUAGE="VBScript" RUNAT=SERVER SRC="class/classaspJSON.vbs"></SCRIPT><%'------------ Variable Definition -------------Dim rsTempDim QueryDim parRtagIdDim parBuildRefDim MachineNamesDim BuildInfoDim BuildLogsDim sMessage'------------ Constants Declaration -----------'------------ Variable Init -------------------parRtagId = Request("rtag_id")parBuildRef = Request("build_ref")Set MachineNames = CreateObject("Scripting.Dictionary")Set BuildLogs = CreateObject("Scripting.Dictionary")Set BuildInfo = CreateObject("Scripting.Dictionary")sMessage = NULL'----------------------------------------------'' Build up a dictionary of build machine names' Get all amchine names as the config may have changed since the log was created'Query = "select display_name, UPPER(MACHINE_HOSTNAME) as MACHINE_HOSTNAME FROM release_manager.build_machine_config"Set rsTemp = OraDatabase.DbCreateDynaset(Query, cint(0))While ((NOT rsTemp.BOF) AND (NOT rsTemp.EOF))Dim mName, dNameMachineNames.Add CStr(rsTemp("MACHINE_HOSTNAME")), CStr(rsTemp("display_name"))rsTemp.MoveNextWEndrsTemp.CloseSet rsTemp = nothing'' Build up a dictionary of build machine config in this release - as it is now'Query = "select display_name, daemon_mode, gbe_value, gbe_buildfilter " &_" from release_manager.release_config rc," &_" release_manager.build_machine_config bm," &_" release_manager.gbe_machtype gbe" &_" where rc.rtag_id=" & parRtagId &_" and rc.bmcon_id=bm.bmcon_id(+)" &_" and rc.gbe_id=gbe.gbe_id" &_" and display_name is not NULL"Set rsTemp = OraDatabase.DbCreateDynaset( Query, ORADYN_DEFAULT )Dim mData(3)While ((NOT rsTemp.BOF) AND (NOT rsTemp.EOF))mData(0) = IIf (CStr(rsTemp("daemon_mode")) = "M", "Master", "Slave")mData(1) = NiceCStr(rsTemp("gbe_value"), "")mData(2) = NiceCStr(rsTemp("gbe_buildfilter"), "-Default-")BuildInfo.Add CStr(rsTemp("display_name")), mDatarsTemp.MoveNextWEndrsTemp.CloseSet rsTemp = nothing'----------------------------------------------' Test that specified package/version exists in dpkg_archive' Can also test presence of the archive' Use http interface as it does not require autheticationSub testLogExistence(sBuildRef)Dim objXMLDim testUrlDim jJSONtestUrl = HTTP_PKG_ARCHIVEtestUrl = testUrl & "/cgi-bin/getBuildLogs.pl"testUrl = testUrl & "?buildRef=" & sBuildReftestUrl = testUrl & "&rtagId=" & parRtagIdErr.ClearOn Error Resume NextSet objXML = CreateObject("MSXML2.ServerXMLHTTP.3.0")objXML.Open "GET", testUrl, FalseobjXML.Sendif Err.Number <> 0 thensMessage = Err.DescriptionOn Error Goto 0elseOn Error Goto 0If objXML.status = 403 thensMessage = "Package Server Access Denied"ElseIf objXML.status <> 200 thensMessage = "Internal Error: Code " & objXML.status'sMessage = objXML.responseTextElseSet jJSON = New aspJSONjJSON.loadJSON( objXML.responseText )Dim txttxt = jJSON.data.item("error")If txt <> "" ThensMessage = txtElseDim this, elSet this = jJSON.data.item("data")For Each el in this.keysDim parts : parts = split( this(el), "/")Dim mName : mName = parts(0)Dim dName : dName = MachineNames.item(mName)If dName = "" ThendName = mName & "*"End IfBuildLogs.Add dName , CStr(this(el))'Response.Write "<pre>Key: " & el & " Value: " & ABTLOG_URL & this(el)NextSet jJSON = nothingSet this = nothingEnd IfEnd IfEnd IfSet objXML = nothingEnd Sub'--- Bfore Render ---------------testLogExistence(parBuildRef )'----------------------------------------------%><html><head><title>Release Manager</title><link rel="shortcut icon" href="<%=FavIcon%>"/><meta HTTP-EQUIV="Pragma" CONTENT="no-cache"><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><link rel="stylesheet" href="images/release_manager_style.css?ver=<%=VixVerNum%>" type="text/css"><script language="JavaScript" src="images/common.js?ver=<%=VixVerNum%>"></script><!--#include file="_jquery_includes.asp"--><script language="javascript">$(document).ready(function () {// Cancel button must close this iFrame using a function provided by the parent$('#btn_cancel').on('click', function (e) {parent.closeIFrame()});// Kill the progress spinner$('#progressBar').hide();});</script></head><body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" ><!-----------------------------------------------------><!-- BODY ----><div class="panel tight"><div id='progressBar' class='vixSpinner' ></div><div class='controlPanel'><!-- MESSAGE +++++++++++++++++++++++++++++++++++++++++++++++++++ --><%Call Messenger ( sMessage , 1, "100%" )%><!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --></div><div class=textPanel>A package is built on one or more build machines. Each build machine will produce a log of the build for the package.The logs are retained for about 10 days and then discarded.</div><div class=listPanel><table width="100%" border="0" cellspacing="1" cellpadding="1" class=stdGrey style="border-collapse: unset;"><thead><th nowrap>Build Machine</th><th nowrap>Mode</th><th nowrap>MACH_TYPE</th><th nowrap>GBE_BUILDFILTER</th></thead><%Dim sName, sPath, hRef, aBuildInfo, sMaster, sMachType, sFilterIf BuildLogs.Count <= 0 Then%><tr><td>No Logs Found. They may have expired</td></tr><%ElseFor Each sName In BuildLogs.KeyssPath = BuildLogs.item(sName)hRef = ABTLOG_URL & "/" & sPathaBuildInfo = BuildInfo.item(sName)If TypeName(aBuildInfo) = "Variant()" ThensMaster = aBuildInfo(0)sMachType = aBuildInfo(1)sFilter = aBuildInfo(2)End If%><tr><td><a href=<%=hRef%> target="_blank"><%=sName%></a></td><td><%=sMaster%></td><td><%=sMachType%></td><td><%=sFilter%></td></tr><%NextEnd If%></table></div><div class=buttonPanelWhite><button id="btn_cancel" class="form_btn">Done</button></div></body></html><%Call Destroy_All_Objects%>