| 7260 |
dpurdie |
1 |
<%@LANGUAGE="VBSCRIPT"%>
|
|
|
2 |
<%
|
|
|
3 |
'=====================================================
|
|
|
4 |
'
|
|
|
5 |
' _iframe_build_logs.asp
|
|
|
6 |
' This page is designed to be called from within an IFRAME
|
|
|
7 |
'
|
|
|
8 |
' Locate log files for a specific build
|
|
|
9 |
'
|
|
|
10 |
'=====================================================
|
|
|
11 |
%>
|
|
|
12 |
<%
|
|
|
13 |
Option explicit
|
|
|
14 |
' Good idea to set when using redirect
|
|
|
15 |
Response.Expires = 0 ' always load the page, dont store
|
|
|
16 |
%>
|
|
|
17 |
<!--#include file="common/conf.asp"-->
|
|
|
18 |
<!--#include file="common/globals.asp"-->
|
|
|
19 |
<!--#include file="common/formating.asp"-->
|
|
|
20 |
<!--#include file="common/qstr.asp"-->
|
|
|
21 |
<!--#include file="common/common_subs.asp"-->
|
|
|
22 |
<!--#include file="common/_form_window_common.asp"-->
|
|
|
23 |
<%
|
|
|
24 |
'------------ ACCESS CONTROL ------------------
|
|
|
25 |
%>
|
|
|
26 |
<!--#include file="_access_control_login.asp"-->
|
|
|
27 |
<!--#include file="_access_control_general.asp"-->
|
|
|
28 |
<SCRIPT LANGUAGE="VBScript" RUNAT=SERVER SRC="class/classaspJSON.vbs"></SCRIPT>
|
|
|
29 |
<%
|
|
|
30 |
'------------ Variable Definition -------------
|
|
|
31 |
Dim rsTemp
|
|
|
32 |
Dim Query
|
|
|
33 |
Dim parRtagId
|
|
|
34 |
Dim parBuildRef
|
|
|
35 |
Dim MachineNames
|
|
|
36 |
Dim BuildInfo
|
|
|
37 |
Dim BuildLogs
|
|
|
38 |
Dim sMessage
|
|
|
39 |
|
|
|
40 |
'------------ Constants Declaration -----------
|
|
|
41 |
'------------ Variable Init -------------------
|
|
|
42 |
parRtagId = Request("rtag_id")
|
|
|
43 |
parBuildRef = Request("build_ref")
|
|
|
44 |
Set MachineNames = CreateObject("Scripting.Dictionary")
|
|
|
45 |
Set BuildLogs = CreateObject("Scripting.Dictionary")
|
|
|
46 |
Set BuildInfo = CreateObject("Scripting.Dictionary")
|
|
|
47 |
sMessage = NULL
|
|
|
48 |
'----------------------------------------------
|
|
|
49 |
'
|
|
|
50 |
' Build up a dictionary of build machine names
|
|
|
51 |
' Get all amchine names as the config may have changed since the log was created
|
|
|
52 |
'
|
|
|
53 |
Query = "select display_name, UPPER(MACHINE_HOSTNAME) as MACHINE_HOSTNAME FROM release_manager.build_machine_config"
|
|
|
54 |
Set rsTemp = OraDatabase.DbCreateDynaset(Query, cint(0))
|
|
|
55 |
While ((NOT rsTemp.BOF) AND (NOT rsTemp.EOF))
|
|
|
56 |
Dim mName, dName
|
|
|
57 |
MachineNames.Add CStr(rsTemp("MACHINE_HOSTNAME")), CStr(rsTemp("display_name"))
|
|
|
58 |
rsTemp.MoveNext
|
|
|
59 |
WEnd
|
|
|
60 |
rsTemp.Close
|
|
|
61 |
Set rsTemp = nothing
|
|
|
62 |
|
|
|
63 |
'
|
|
|
64 |
' Build up a dictionary of build machine config in this release - as it is now
|
|
|
65 |
'
|
|
|
66 |
Query = "select display_name, daemon_mode, gbe_value, gbe_buildfilter " &_
|
|
|
67 |
" from release_manager.release_config rc," &_
|
|
|
68 |
" release_manager.build_machine_config bm," &_
|
|
|
69 |
" release_manager.gbe_machtype gbe" &_
|
|
|
70 |
" where rc.rtag_id=" & parRtagId &_
|
|
|
71 |
" and rc.bmcon_id=bm.bmcon_id(+)" &_
|
|
|
72 |
" and rc.gbe_id=gbe.gbe_id"
|
|
|
73 |
Set rsTemp = OraDatabase.DbCreateDynaset( Query, ORADYN_DEFAULT )
|
|
|
74 |
|
|
|
75 |
Dim mData(3)
|
|
|
76 |
While ((NOT rsTemp.BOF) AND (NOT rsTemp.EOF))
|
|
|
77 |
mData(0) = IIf (CStr(rsTemp("daemon_mode")) = "M", "Master", "Slave")
|
|
|
78 |
mData(1) = CStr(rsTemp("gbe_value"))
|
|
|
79 |
mData(2) = CStr(rsTemp("gbe_buildfilter"))
|
|
|
80 |
BuildInfo.Add CStr(rsTemp("display_name")), mData
|
|
|
81 |
rsTemp.MoveNext
|
|
|
82 |
WEnd
|
|
|
83 |
rsTemp.Close
|
|
|
84 |
Set rsTemp = nothing
|
|
|
85 |
|
|
|
86 |
'----------------------------------------------
|
|
|
87 |
' Test that specified package/version exists in dpkg_archive
|
|
|
88 |
' Can also test presence of the archive
|
|
|
89 |
' Use http interface as it does not require authetication
|
|
|
90 |
Sub testLogExistence(sBuildRef)
|
|
|
91 |
Dim objXML
|
|
|
92 |
Dim testUrl
|
|
|
93 |
Dim jJSON
|
|
|
94 |
|
|
|
95 |
testUrl = HTTP_PKG_ARCHIVE
|
|
|
96 |
testUrl = testUrl & "/cgi-bin/getBuildLogs.pl"
|
|
|
97 |
testUrl = testUrl & "?buildRef=" & sBuildRef
|
|
|
98 |
testUrl = testUrl & "&rtagId=" & parRtagId
|
|
|
99 |
|
|
|
100 |
Err.Clear
|
|
|
101 |
On Error Resume Next
|
|
|
102 |
|
|
|
103 |
Set objXML = CreateObject("MSXML2.ServerXMLHTTP.3.0")
|
|
|
104 |
objXML.Open "GET", testUrl, False
|
|
|
105 |
objXML.Send
|
|
|
106 |
|
|
|
107 |
if Err.Number <> 0 then
|
|
|
108 |
sMessage = Err.Description
|
|
|
109 |
On Error Goto 0
|
|
|
110 |
else
|
|
|
111 |
On Error Goto 0
|
|
|
112 |
If objXML.status = 403 then
|
|
|
113 |
sMessage = "Package Server Access Denied"
|
|
|
114 |
|
|
|
115 |
ElseIf objXML.status <> 200 then
|
|
|
116 |
sMessage = "Internal Error: Code " & objXML.status
|
|
|
117 |
'sMessage = objXML.responseText
|
|
|
118 |
Else
|
|
|
119 |
Set jJSON = New aspJSON
|
|
|
120 |
jJSON.loadJSON( objXML.responseText )
|
|
|
121 |
|
|
|
122 |
Dim txt
|
|
|
123 |
txt = jJSON.data.item("error")
|
|
|
124 |
If txt <> "" Then
|
|
|
125 |
sMessage = txt
|
|
|
126 |
Else
|
|
|
127 |
Dim this, el
|
|
|
128 |
Set this = jJSON.data.item("data")
|
|
|
129 |
For Each el in this.keys
|
|
|
130 |
Dim parts : parts = split( this(el), "/")
|
|
|
131 |
Dim mName : mName = parts(0)
|
|
|
132 |
Dim dName : dName = MachineNames.item(mName)
|
|
|
133 |
If dName = "" Then
|
|
|
134 |
dName = mName & "*"
|
|
|
135 |
End If
|
|
|
136 |
BuildLogs.Add dName , CStr(this(el))
|
|
|
137 |
'Response.Write "<pre>Key: " & el & " Value: " & ABTLOG_URL & this(el)
|
|
|
138 |
Next
|
|
|
139 |
Set jJSON = nothing
|
|
|
140 |
Set this = nothing
|
|
|
141 |
End If
|
|
|
142 |
End If
|
|
|
143 |
End If
|
|
|
144 |
Set objXML = nothing
|
|
|
145 |
End Sub
|
|
|
146 |
|
|
|
147 |
'--- Bfore Render ---------------
|
|
|
148 |
testLogExistence(parBuildRef )
|
|
|
149 |
'----------------------------------------------
|
|
|
150 |
%>
|
|
|
151 |
<html>
|
|
|
152 |
<head>
|
|
|
153 |
<title>Release Manager</title>
|
|
|
154 |
<link rel="shortcut icon" href="<%=FavIcon%>"/>
|
|
|
155 |
<meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
|
|
|
156 |
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
|
|
157 |
<link rel="stylesheet" href="images/release_manager_style.css?ver=<%=VixVerNum%>" type="text/css">
|
|
|
158 |
<script language="JavaScript" src="images/common.js?ver=<%=VixVerNum%>"></script>
|
|
|
159 |
<!--#include file="_jquery_includes.asp"-->
|
|
|
160 |
<script language="javascript">
|
|
|
161 |
$(document).ready(function () {
|
|
|
162 |
// Cancel button must close this iFrame using a function provided by the parent
|
|
|
163 |
$('#btn_cancel').on('click', function (e) {parent.closeIFrame()});
|
|
|
164 |
|
|
|
165 |
// Kill the progress spinner
|
|
|
166 |
$('#progressBar').hide();
|
|
|
167 |
});
|
|
|
168 |
</script>
|
|
|
169 |
</head>
|
|
|
170 |
<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" >
|
|
|
171 |
<!----------------------------------------------------->
|
|
|
172 |
<!-- BODY ---->
|
|
|
173 |
<div class="panel tight">
|
|
|
174 |
<div id='progressBar' class='vixSpinner' ></div>
|
|
|
175 |
<div class='controlPanel'>
|
|
|
176 |
<!-- MESSAGE +++++++++++++++++++++++++++++++++++++++++++++++++++ -->
|
|
|
177 |
<%Call Messenger ( sMessage , 1, "100%" )%>
|
|
|
178 |
<!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
|
|
|
179 |
</div>
|
|
|
180 |
<div class=textPanel>
|
|
|
181 |
A package is built on one or more build machines. Each build machine will produce a log of the build for the package.
|
|
|
182 |
The logs are retained for about 10 days and then discarded.
|
|
|
183 |
</div>
|
|
|
184 |
<div class=listPanel>
|
|
|
185 |
<table width="100%" border="0" cellspacing="1" cellpadding="1" class=stdGrey style="border-collapse: unset;">
|
|
|
186 |
<thead>
|
|
|
187 |
<th nowrap>Build Machine</th>
|
|
|
188 |
<th nowrap>Mode</th>
|
|
|
189 |
<th nowrap>MACH_TYPE</th>
|
|
|
190 |
<th nowrap>GBE_BUILDFILTER</th>
|
|
|
191 |
</thead>
|
|
|
192 |
<%
|
|
|
193 |
Dim sName, sPath, hRef, aBuildInfo, sMaster, sMachType, sFilter
|
|
|
194 |
If BuildLogs.Count <= 0 Then%>
|
|
|
195 |
<tr>
|
|
|
196 |
<td>No Logs Found. They may have expired</td>
|
|
|
197 |
</tr>
|
|
|
198 |
<%Else
|
|
|
199 |
For Each sName In BuildLogs.Keys
|
|
|
200 |
sPath = BuildLogs.item(sName)
|
|
|
201 |
hRef = ABTLOG_URL & "/" & sPath
|
|
|
202 |
aBuildInfo = BuildInfo.item(sName)
|
|
|
203 |
If TypeName(aBuildInfo) = "Variant()" Then
|
|
|
204 |
sMaster = aBuildInfo(0)
|
|
|
205 |
sMachType = aBuildInfo(1)
|
|
|
206 |
sFilter = aBuildInfo(2)
|
|
|
207 |
End If
|
|
|
208 |
%>
|
|
|
209 |
<tr>
|
|
|
210 |
<td><a href=<%=hRef%> target="_blank"><%=sName%></a></td>
|
|
|
211 |
<td><%=sMaster%></td>
|
|
|
212 |
<td><%=sMachType%></td>
|
|
|
213 |
<td><%=sFilter%></td>
|
|
|
214 |
</tr>
|
|
|
215 |
<%
|
|
|
216 |
Next
|
|
|
217 |
End If%>
|
|
|
218 |
</table>
|
|
|
219 |
</div>
|
|
|
220 |
<div class=buttonPanelWhite>
|
|
|
221 |
<button id="btn_cancel" class="form_btn">Done</button>
|
|
|
222 |
</div>
|
|
|
223 |
</body>
|
|
|
224 |
</html>
|
|
|
225 |
<%
|
|
|
226 |
Call Destroy_All_Objects
|
|
|
227 |
%>
|