| 119 |
ghuddy |
1 |
<?xml version="1.0" ?>
|
|
|
2 |
<package>
|
|
|
3 |
<comment>
|
|
|
4 |
PrimalCode wizard generated file.
|
|
|
5 |
</comment>
|
|
|
6 |
<job id="GetComponents" args="/pv_id:24498 /f:Y" prompt="no">
|
|
|
7 |
<?job error="true" debug="true" ?>
|
|
|
8 |
<runtime>
|
|
|
9 |
<named helpstring="Package Name" name="pkg_name" required="false" type="string"/>
|
|
|
10 |
<named helpstring="Package Version" name="pkg_version" required="false" type="string"/>
|
|
|
11 |
<named helpstring="Package primary key" name="pv_id" required="false" type="string"/>
|
|
|
12 |
<named helpstring="Force Release Notes Generation" name="f" required="false" type="string"/>
|
|
|
13 |
<usage>
|
|
|
14 |
Usage:
|
|
|
15 |
on_Make_Official.wsf [/pkg_name:value] [/pkg_version:value]
|
|
|
16 |
OR
|
|
|
17 |
on_Make_Official.wsf [/pv_id:value]
|
|
|
18 |
|
|
|
19 |
Options:
|
|
|
20 |
|
|
|
21 |
pkg_name : Package Name
|
|
|
22 |
pkg_version : Package Version
|
|
|
23 |
pv_id : Package Version primary key
|
|
|
24 |
f: Set to [Y] to force release notes generation
|
|
|
25 |
</usage>
|
|
|
26 |
</runtime>
|
|
|
27 |
<object id="CDOMessage_Class" progid="CDO.Message" events="true"/>
|
|
|
28 |
<object id="Oracle_Objects_For_OLE" progid="OracleInProcServer.XOraSession" events="true"/>
|
|
|
29 |
<script language="VBScript" src="common_subs.vbs"/>
|
|
|
30 |
<script language="VBScript" src="config.vbs"/>
|
|
|
31 |
<script language="VBScript" src="pkg_archive.vbs"/>
|
|
|
32 |
<script id="GetComponents" language="VBScript">
|
|
|
33 |
<![CDATA[
|
|
|
34 |
Option Explicit
|
|
|
35 |
'=====================================================
|
|
|
36 |
' Name: GetComponents
|
|
|
37 |
' Description: Connects to dpkg_archive and gets the
|
|
|
38 |
' content of folders and files of certain
|
|
|
39 |
' package. It then stores this info into
|
|
|
40 |
' Release Manager database. This info can
|
|
|
41 |
' later be included in release notes Or
|
|
|
42 |
' searched with search engine.
|
|
|
43 |
' INPUT: pkg_name
|
|
|
44 |
' pkg_version
|
|
|
45 |
'=====================================================
|
|
|
46 |
|
|
|
47 |
'================ Variable Definition ================
|
|
|
48 |
Dim compARR()
|
|
|
49 |
Dim objArgs
|
|
|
50 |
Dim parPv_id
|
|
|
51 |
Dim parPkg_name
|
|
|
52 |
Dim parRtag_name
|
|
|
53 |
Dim parProj_id
|
|
|
54 |
Dim parPkg_Version
|
|
|
55 |
Dim No_Components
|
|
|
56 |
'=============== Constants Declaration ===============
|
|
|
57 |
Const COL_file_name = 0
|
|
|
58 |
Const COL_file_path = 1
|
|
|
59 |
Const COL_byte_size = 2
|
|
|
60 |
Const COL_crc_cksum = 3
|
|
|
61 |
Const COL_crc_modcrc= 4
|
|
|
62 |
Const NUMBER_OF_COLS_IN_ARRcomp = 5
|
|
|
63 |
Const MODCRC_FILE_TYPES = "*.thx" ' Comma separated file types to be CRCed with modcrc. E.g. "*.thx, *.bin, *.blah"
|
|
|
64 |
'================== Variable Init ====================
|
|
|
65 |
No_Components = True
|
|
|
66 |
'=====================================================
|
|
|
67 |
'-----------------------------------------------------------------------------------------------------------------
|
|
|
68 |
Sub DESCPKG_File_Check ( sPath )
|
|
|
69 |
Dim oFileSys
|
|
|
70 |
Set oFileSys = CreateObject ("Scripting.FileSystemObject")
|
|
|
71 |
|
|
|
72 |
If NOT oFileSys.FileExists( sPath &"\"& DESCPKG_FILE ) Then
|
|
|
73 |
Call SaveFile( sPath, DESCPKG_FILE, parPkg_name &" "& parPkg_Version ) ' Create descpkg file
|
|
|
74 |
End If
|
|
|
75 |
End Sub
|
|
|
76 |
'-----------------------------------------------------------------------------------------------------------------
|
|
|
77 |
Function Get_All_Files ( SSpath )
|
|
|
78 |
Dim sysShell, oExec, outStdErr, outStrOut
|
|
|
79 |
|
|
|
80 |
Set sysShell = WScript.CreateObject("WScript.Shell")
|
|
|
81 |
Set oExec = sysShell.Exec( "cmd /c dir /S /B /A:-D "& SSpath )
|
|
|
82 |
|
|
|
83 |
outStrOut = oExec.StdOut.ReadAll
|
|
|
84 |
|
|
|
85 |
Get_All_Files = outStrOut
|
|
|
86 |
End Function
|
|
|
87 |
'-----------------------------------------------------------------------------------------------------------------
|
|
|
88 |
Function Get_All_Folders ( SSpath )
|
|
|
89 |
Dim sysShell, oExec, outStdErr, outStrOut
|
|
|
90 |
|
|
|
91 |
Set sysShell = WScript.CreateObject("WScript.Shell")
|
|
|
92 |
Set oExec = sysShell.Exec( "cmd /c dir /S /B /A:D "& SSpath )
|
|
|
93 |
|
|
|
94 |
outStrOut = oExec.StdOut.ReadAll
|
|
|
95 |
|
|
|
96 |
Get_All_Folders = outStrOut
|
|
|
97 |
End Function
|
|
|
98 |
'-----------------------------------------------------------------------------------------------------------------
|
|
|
99 |
Function File_Extention ( SSfile_name )
|
|
|
100 |
If InStr ( SSfile_name, "." ) Then
|
|
|
101 |
File_Extention = Right ( SSfile_name, Len(SSfile_name) - InStrRev( SSfile_name, "." ) + 1 )
|
|
|
102 |
Else
|
|
|
103 |
' No dot seperator
|
|
|
104 |
File_Extention = ""
|
|
|
105 |
End If
|
|
|
106 |
End Function
|
|
|
107 |
'-----------------------------------------------------------------------------------------------------------------
|
|
|
108 |
Sub Split_Path ( SSpath, outFile_name, outFile_path, outFile_ext )
|
|
|
109 |
Dim rightSlashLoc
|
|
|
110 |
|
|
|
111 |
If InStr( SSpath, "\" ) Then
|
|
|
112 |
rightSlashLoc = InStrRev( SSpath, "\" )
|
|
|
113 |
outFile_path = Left( SSpath, rightSlashLoc )
|
|
|
114 |
outFile_name = Replace( SSpath, outFile_path, "" )
|
|
|
115 |
outFile_ext = File_Extention ( outFile_name )
|
|
|
116 |
|
|
|
117 |
Else
|
|
|
118 |
outFile_name = SSpath
|
|
|
119 |
outFile_path = ""
|
|
|
120 |
outFile_ext = File_Extention ( outFile_name )
|
|
|
121 |
|
|
|
122 |
End If
|
|
|
123 |
|
|
|
124 |
End Sub
|
|
|
125 |
'-----------------------------------------------------------------------------------------------------------------
|
|
|
126 |
Sub Generate_CRC ( SSfile_name, SSfile_path, SSfile_ext, outSize, outCRC_cksum, outCRC_modcrc )
|
|
|
127 |
Dim ModCRC_fileTypes
|
|
|
128 |
ModCRC_fileTypes = Replace( MODCRC_FILE_TYPES, " ", "" ) ' Remove spaces
|
|
|
129 |
ModCRC_fileTypes = Replace( ModCRC_fileTypes, "*", "" ) ' Remove *
|
|
|
130 |
ModCRC_fileTypes = "|"& Replace( ModCRC_fileTypes, ",", "||" ) &"|" ' Convert to from "a,b,c" to "|a||b||c|"
|
|
|
131 |
|
|
|
132 |
' --- cksum CRC ---
|
|
|
133 |
Call CRC_cksum ( SSfile_path & SSfile_name, outCRC_cksum, outSize )
|
|
|
134 |
|
|
|
135 |
' --- modcrc CRC ---
|
|
|
136 |
If InStr( ModCRC_fileTypes, "|"& SSfile_ext &"|" ) > 0 Then
|
|
|
137 |
Call CRC_modcrc ( Left( SSfile_name, Len(SSfile_name) - Len(SSfile_ext) ), SSfile_path, outCRC_modcrc, outSize )
|
|
|
138 |
End If
|
|
|
139 |
|
|
|
140 |
WScript.Echo SSfile_name &" "& outCRC_cksum &" "& outSize &" "& outCRC_modcrc
|
|
|
141 |
|
|
|
142 |
End Sub
|
|
|
143 |
'-----------------------------------------------------------------------------------------------------------------
|
|
|
144 |
Sub Get_Components ( ARRcomp )
|
|
|
145 |
Dim fileSys, rootPath, contentsDump, recCnt, objPkgFileSys
|
|
|
146 |
Dim file_ext, path, tempARR, pkgType
|
|
|
147 |
|
|
|
148 |
Set objPkgFileSys = New PkgArchive
|
|
|
149 |
|
|
|
150 |
objPkgFileSys.Map_Network_Drive UNC_ARCHIVE, MappedDrive ' Map Drive if required
|
|
|
151 |
|
|
|
152 |
pkgType = Get_Package_Type ( parPv_id )
|
|
|
153 |
|
|
|
154 |
' Is this package ERG PRODUCT
|
|
|
155 |
objPkgFileSys.Remote_Host = TELNET_MACHINE
|
|
|
156 |
If pkgType = enumPKG_TYPE_ERG_PRODUCT Then
|
|
|
157 |
rootPath = MappedDrive & DEPLOY_ARCHIVE &"\"& parPkg_name &"\"& parPkg_Version
|
|
|
158 |
objPkgFileSys.Archive_Path = TELNET_DEPLOY_ARCHIVE
|
|
|
159 |
|
|
|
160 |
'%%%%% Creation of Product folder is just temporary.
|
|
|
161 |
'%%%%% Remove the line objPkgFileSys.Create_Pkg_Folder parPkg_name, parPkg_version when depoly_archive is in production
|
|
|
162 |
objPkgFileSys.Create_Pkg_Folder parPkg_name, parPkg_Version
|
|
|
163 |
'%%%%% Remove line above ^^^^^^^^^^
|
|
|
164 |
|
|
|
165 |
Else
|
|
|
166 |
rootPath = MappedDrive & DPKG_ARCHIVE &"\"& parPkg_name &"\"& parPkg_Version
|
|
|
167 |
objPkgFileSys.Archive_Path = TELNET_DPKG_ARCHIVE
|
|
|
168 |
|
|
|
169 |
End If
|
|
|
170 |
|
|
|
171 |
Set fileSys = CreateObject("Scripting.FileSystemObject")
|
|
|
172 |
|
|
|
173 |
Dim contentsFolderDump, aFolders, oFolders, sFolderName
|
|
|
174 |
|
|
|
175 |
If fileSys.FolderExists( rootPath ) Then
|
|
|
176 |
objPkgFileSys.Ensure_Read_Write parPkg_name, parPkg_version ' Make sure all files and folders can be read
|
|
|
177 |
Call DESCPKG_File_Check ( rootPath ) ' Create descpkg file if required
|
|
|
178 |
|
|
|
179 |
contentsDump = Get_All_Files ( rootPath )
|
|
|
180 |
contentsFolderDump = Get_All_Folders ( rootPath )
|
|
|
181 |
|
|
|
182 |
contentsDump = contentsFolderDump & contentsDump ' Combine Files and Folders
|
|
|
183 |
|
|
|
184 |
contentsDump = Replace( contentsDump, "/", "\" ) ' Make sure "\" is used
|
|
|
185 |
contentsDump = Replace( contentsDump, rootPath &"\", "" ) ' Remove UNC root path
|
|
|
186 |
|
|
|
187 |
contentsFolderDump = Replace( contentsFolderDump, "/", "\" ) ' Make sure "\" is used
|
|
|
188 |
contentsFolderDump = Replace( contentsFolderDump, rootPath &"\", "" ) ' Remove UNC root path
|
|
|
189 |
|
|
|
190 |
tempARR = Split( contentsDump, VBNewLine ) ' Split each line containing path + file name
|
|
|
191 |
aFolders = Split( contentsFolderDump, VBNewLine ) ' Split each line containing path
|
|
|
192 |
|
|
|
193 |
|
|
|
194 |
'-- Populate Folder dictionary --
|
|
|
195 |
Set oFolders = CreateObject("Scripting.Dictionary")
|
|
|
196 |
|
|
|
197 |
' Continue if folders exist
|
|
|
198 |
If Len(contentsFolderDump) > 1 Then
|
|
|
199 |
For Each sFolderName In aFolders
|
|
|
200 |
oFolders.Item ( sFolderName ) = ""
|
|
|
201 |
Next
|
|
|
202 |
End If
|
|
|
203 |
|
|
|
204 |
|
|
|
205 |
|
|
|
206 |
'-- Generate file list
|
|
|
207 |
WScript.Echo "Attempting to generate file list..."
|
|
|
208 |
recCnt = 0
|
|
|
209 |
For Each path In tempARR
|
|
|
210 |
If path <> "" Then
|
|
|
211 |
ReDim Preserve ARRcomp( NUMBER_OF_COLS_IN_ARRcomp, recCnt )
|
|
|
212 |
|
|
|
213 |
Call Split_Path ( path, _
|
|
|
214 |
ARRcomp( COL_file_name, recCnt ), _
|
|
|
215 |
ARRcomp( COL_file_path, recCnt ), _
|
|
|
216 |
file_ext )
|
|
|
217 |
|
|
|
218 |
' Don't do CRC on folders
|
|
|
219 |
If oFolders.Exists( path ) Then
|
|
|
220 |
' Store Folder information
|
|
|
221 |
ARRcomp( COL_file_name, recCnt ) = ""
|
|
|
222 |
ARRcomp( COL_file_path, recCnt ) = path
|
|
|
223 |
ARRcomp( COL_byte_size, recCnt ) = 0
|
|
|
224 |
ARRcomp( COL_crc_cksum, recCnt ) = ""
|
|
|
225 |
ARRcomp( COL_crc_modcrc, recCnt ) = ""
|
|
|
226 |
|
|
|
227 |
Else
|
|
|
228 |
Call Generate_CRC ( ARRcomp( COL_file_name, recCnt ), _
|
|
|
229 |
rootPath &"\"& ARRcomp( COL_file_path, recCnt ), _
|
|
|
230 |
file_ext, _
|
|
|
231 |
ARRcomp( COL_byte_size, recCnt ), _
|
|
|
232 |
ARRcomp( COL_crc_cksum, recCnt ), _
|
|
|
233 |
ARRcomp( COL_crc_modcrc, recCnt ) )
|
|
|
234 |
End If
|
|
|
235 |
|
|
|
236 |
recCnt = recCnt + 1
|
|
|
237 |
End If
|
|
|
238 |
|
|
|
239 |
No_Components = FALSE
|
|
|
240 |
Next
|
|
|
241 |
|
|
|
242 |
|
|
|
243 |
Else
|
|
|
244 |
Call Raise_Event ( enumEVENT_ERROR, "[job:GetComponents sub:Get_Components]", rootPath, "Path not found!", enum_RELEASE_NOTES_NOT_FOUND_IN_ARCHIVE )
|
|
|
245 |
|
|
|
246 |
End If
|
|
|
247 |
|
|
|
248 |
End Sub
|
|
|
249 |
'-----------------------------------------------------------------------------------------------------------------
|
|
|
250 |
Sub Insert_Into_Database ( ARRcomp )
|
|
|
251 |
Dim i
|
|
|
252 |
|
|
|
253 |
If No_Components Then Exit Sub ' If no file components are found, there is nothing to do.
|
|
|
254 |
|
|
|
255 |
' Insert into database
|
|
|
256 |
If parPv_id <> -1 Then
|
|
|
257 |
OraSession.BeginTrans
|
|
|
258 |
WScript.Echo "Deleting old entries from [release_components] table for PV_ID = "& parPv_id
|
|
|
259 |
OraDatabase.ExecuteSQL "DELETE FROM release_components WHERE pv_id = "& parPv_id ' Make sure it doesnot exists
|
|
|
260 |
|
|
|
261 |
WScript.Echo "Inserting new component details In [release_components] table."
|
|
|
262 |
|
|
|
263 |
For i = 0 To UBound( ARRcomp, 2 )
|
|
|
264 |
OraDatabase.ExecuteSQL _
|
|
|
265 |
" INSERT INTO release_components ( pv_id, file_name, file_path, byte_size, crc_cksum, crc_modcrc )"&_
|
|
|
266 |
" VALUES ( "&_
|
|
|
267 |
parPv_id &", "&_
|
|
|
268 |
" '"& ARRcomp( COL_file_name, i ) &"', "&_
|
|
|
269 |
" '"& ARRcomp( COL_file_path, i ) &"', "&_
|
|
|
270 |
ARRcomp( COL_byte_size, i ) &", "&_
|
|
|
271 |
" '"& ARRcomp( COL_crc_cksum, i ) &"', "&_
|
|
|
272 |
" '"& ARRcomp( COL_crc_modcrc, i ) &"' "&_
|
|
|
273 |
" )"
|
|
|
274 |
Next
|
|
|
275 |
|
|
|
276 |
OraSession.CommitTrans
|
|
|
277 |
End If
|
|
|
278 |
|
|
|
279 |
End Sub
|
|
|
280 |
'-----------------------------------------------------------------------------------------------------------------
|
|
|
281 |
'-------------------- MAIN LINE ----------------------
|
|
|
282 |
WScript.Echo "==================== job:GenerateComponents ===================="
|
|
|
283 |
|
|
|
284 |
Set objArgs = WScript.Arguments
|
|
|
285 |
|
|
|
286 |
If (objArgs.Unnamed.Count > 0) Then
|
|
|
287 |
Wscript.Echo "ERROR: Unnamed parameters!"
|
|
|
288 |
objArgs.ShowUsage
|
|
|
289 |
WScript.Quit
|
|
|
290 |
|
|
|
291 |
Else
|
|
|
292 |
parPkg_name = objArgs.Named.Item("pkg_name")
|
|
|
293 |
parPkg_Version = objArgs.Named.Item("pkg_version")
|
|
|
294 |
parPv_id = objArgs.Named.Item("pv_id")
|
|
|
295 |
parRtag_name = objArgs.Named.Item("rtag_name")
|
|
|
296 |
parProj_id = objArgs.Named.Item("proj_id")
|
|
|
297 |
|
|
|
298 |
If ( parPkg_name <> "" AND parPkg_Version <> "") Then
|
|
|
299 |
Call Get_PV_ID ( parPkg_name, parPkg_Version, parPv_id )
|
|
|
300 |
|
|
|
301 |
ElseIf parPv_id <> "" Then
|
|
|
302 |
Call Get_Pkg_Name_Version ( parPv_id, parPkg_name, parPkg_Version )
|
|
|
303 |
|
|
|
304 |
Else
|
|
|
305 |
objArgs.ShowUsage
|
|
|
306 |
WScript.Quit
|
|
|
307 |
|
|
|
308 |
End If
|
|
|
309 |
|
|
|
310 |
End If
|
|
|
311 |
|
|
|
312 |
Call Check_Requirements_To_Proceed ( parPv_id )
|
|
|
313 |
Call Get_Components ( compARR )
|
|
|
314 |
Call Insert_Into_Database ( compARR )
|
|
|
315 |
|
|
|
316 |
WScript.Echo "Components generated successfully!"
|
|
|
317 |
|
|
|
318 |
|
|
|
319 |
]]>
|
|
|
320 |
</script>
|
|
|
321 |
</job>
|
|
|
322 |
<job id="GenerateReleaseNotes" args="/pv_id:30261 /f:Y" prompt="no">
|
|
|
323 |
<?job error="true" debug="true" ?>
|
|
|
324 |
<runtime>
|
|
|
325 |
<named helpstring="Package Name" name="pkg_name" required="false" type="string"/>
|
|
|
326 |
<named helpstring="Package Version" name="pkg_version" required="false" type="string"/>
|
|
|
327 |
<named helpstring="Package primary key" name="pv_id" required="false" type="simple"/>
|
|
|
328 |
<named helpstring="Force Release Notes Generation" name="f" required="false" type="string"/>
|
|
|
329 |
<named helpstring="Output release notes file" name="file" required="false" type="string"/>
|
|
|
330 |
<usage>
|
|
|
331 |
Usage:
|
|
|
332 |
on_Make_Official.wsf [/pkg_name:value] [/pkg_version:value]
|
|
|
333 |
OR
|
|
|
334 |
on_Make_Official.wsf [/pv_id:value]
|
|
|
335 |
|
|
|
336 |
Options:
|
|
|
337 |
|
|
|
338 |
pkg_name : Package Name
|
|
|
339 |
pkg_version : Package Version
|
|
|
340 |
pv_id : Package Version primary key
|
|
|
341 |
</usage>
|
|
|
342 |
</runtime>
|
|
|
343 |
<object id="Oracle_Objects_For_OLE" progid="OracleInProcServer.XOraSession" events="true"/>
|
|
|
344 |
<resource id="Runtime Dependencies"><![CDATA[**** SSH key
|
|
|
345 |
|
|
|
346 |
SSH needs to be run manually first time to obtain the key from
|
|
|
347 |
the telnet server.
|
|
|
348 |
|
|
|
349 |
Example: plink -ssh username@telnetserver
|
|
|
350 |
|
|
|
351 |
**** SMTP server
|
|
|
352 |
To be able to receive email notifications from the web server,
|
|
|
353 |
make sure that SMTP server is running. This server is also used
|
|
|
354 |
by Release Manager notification facility.
|
|
|
355 |
|
|
|
356 |
]]></resource>
|
|
|
357 |
<script language="VBScript" src="templates\style_b_generator.vbs"/>
|
|
|
358 |
<script language="VBScript" src="templates\style_a_generator.vbs"/>
|
|
|
359 |
<script language="VBScript" src="common_subs.vbs"/>
|
|
|
360 |
<script language="VBScript" src="config.vbs"/>
|
|
|
361 |
<script language="VBScript" src="pkg_archive.vbs"/>
|
|
|
362 |
<script id="GenerateReleaseNotes" language="VBScript">
|
|
|
363 |
<![CDATA[
|
|
|
364 |
Option Explicit
|
|
|
365 |
'=====================================================
|
|
|
366 |
' Name: GenerateReleaseNotes
|
|
|
367 |
' Description: Generates release notes from
|
|
|
368 |
' Release Manager database and stores
|
|
|
369 |
' it into doc folder on dpkg / deploy
|
|
|
370 |
' INPUT: pkg_name
|
|
|
371 |
' pkg_version
|
|
|
372 |
'=====================================================
|
|
|
373 |
|
|
|
374 |
'================ Variable Definition ================
|
|
|
375 |
Dim objArgs
|
|
|
376 |
Dim parPv_id
|
|
|
377 |
Dim parPkg_name
|
|
|
378 |
Dim parRtag_name
|
|
|
379 |
Dim parProj_id
|
|
|
380 |
Dim parPkg_Version
|
|
|
381 |
'=============== Constants Declaration ===============
|
|
|
382 |
Const enumLoc_iss_db = 0
|
|
|
383 |
Const enumLoc_iss_id = 1
|
|
|
384 |
Const enumLoc_iss_num = 2
|
|
|
385 |
Const enumLoc_summary = 3
|
|
|
386 |
Const enumLoc_status = 4
|
|
|
387 |
Const enumLoc_priority = 5
|
|
|
388 |
Const enumLoc_issue_type = 6
|
|
|
389 |
Const enumLoc_submitter = 7
|
|
|
390 |
Const enumLoc_defect_in = 8
|
|
|
391 |
Const enumLoc_submit_date = 9
|
|
|
392 |
Const enumLoc_project = 10
|
|
|
393 |
Const enumLoc_owner = 11
|
|
|
394 |
Const enumLoc_product = 12
|
|
|
395 |
Const enumLoc_approver = 13
|
|
|
396 |
Const enumLoc_package = 14
|
|
|
397 |
Const enumLoc_description = 15
|
|
|
398 |
Const enumLoc_notes_log = 16
|
|
|
399 |
Const enumLoc_release_id = 17
|
|
|
400 |
Const enumLoc_client_ref = 18
|
|
|
401 |
Const enumLoc_severity = 19
|
|
|
402 |
Const enumLoc_change_request = 20
|
|
|
403 |
'================== Variable Init ====================
|
|
|
404 |
'=====================================================
|
|
|
405 |
'-----------------------------------------------------------------------------------------------------------------
|
|
|
406 |
Sub Get_Snippet ( SSname, SSnotesSTR, outSnippetSTR, outInsertFrom )
|
|
|
407 |
Dim beginSnippet, endSnippet
|
|
|
408 |
|
|
|
409 |
beginSnippet = InStr( SSnotesSTR, "SnippetName="""& SSname &"""")
|
|
|
410 |
If beginSnippet <> 0 Then
|
|
|
411 |
beginSnippet = InStr( beginSnippet, SSnotesSTR, VBNewLine ) ' Find beginning of the code
|
|
|
412 |
endSnippet = InStr( beginSnippet, SSnotesSTR, "EndOfSnippet" ) - 1
|
|
|
413 |
outInsertFrom = InStr( endSnippet, SSnotesSTR, "-->" ) + 3
|
|
|
414 |
outSnippetSTR = Mid( SSnotesSTR, beginSnippet, endSnippet - beginSnippet )
|
|
|
415 |
|
|
|
416 |
Else
|
|
|
417 |
Call Raise_Event ( enumEVENT_ERROR, "[job:GenerateReleaseNotes sub:Get_Snippet]", _
|
|
|
418 |
"SnippetName: "& SSname , _
|
|
|
419 |
"SnippetName not found!", enum_RELEASE_NOTES_FAILED )
|
|
|
420 |
|
|
|
421 |
End If
|
|
|
422 |
|
|
|
423 |
End Sub
|
|
|
424 |
'-----------------------------------------------------------------------------------------------------------------
|
|
|
425 |
Function ArrayRecord ( NNcolumn, SSrecCode, DDdepIss, AAdepIss )
|
|
|
426 |
If NOT DDdepIss.Exists ( SSrecCode ) Then Exit Function
|
|
|
427 |
|
|
|
428 |
ArrayRecord = NVL( AAdepIss ( NNcolumn, CInt( DDdepIss.Item (SSrecCode) ) ) )
|
|
|
429 |
End Function
|
|
|
430 |
'-----------------------------------------------------------------------------------------------------------------
|
|
|
431 |
Sub Insert_To_Page ( notesSTR, insertFrom, insterSTR )
|
|
|
432 |
notesSTR = Left( notesSTR, insertFrom ) & insterSTR & Right( notesSTR, Len(notesSTR) - insertFrom )
|
|
|
433 |
insterSTR = NULL ' Clear the insert string
|
|
|
434 |
End Sub
|
|
|
435 |
'-----------------------------------------------------------------------------------------------------------------
|
|
|
436 |
Sub Group_By ( rsG, outCurrG, snippetSTR, outSTR, BBchanged )
|
|
|
437 |
If rsG = outCurrG Then Exit Sub
|
|
|
438 |
|
|
|
439 |
outSTR = outSTR & snippetSTR
|
|
|
440 |
outCurrG = rsG
|
|
|
441 |
BBchanged = TRUE
|
|
|
442 |
End Sub
|
|
|
443 |
'-----------------------------------------------------------------------------------------------------------------
|
|
|
444 |
Sub Generate_Release_Notes ( )
|
|
|
445 |
Dim objPkgFileSys, docPath, rootPath
|
|
|
446 |
Dim notesSTR, pkgType
|
|
|
447 |
|
|
|
448 |
Set objPkgFileSys = New PkgArchive
|
|
|
449 |
|
|
|
450 |
|
|
|
451 |
objPkgFileSys.Map_Network_Drive UNC_ARCHIVE, MappedDrive ' Map Drive if required
|
|
|
452 |
|
|
|
453 |
pkgType = Get_Package_Type ( parPv_id )
|
|
|
454 |
|
|
|
455 |
objPkgFileSys.Remote_Host = TELNET_MACHINE
|
|
|
456 |
If pkgType = enumPKG_TYPE_ERG_PRODUCT Then
|
|
|
457 |
rootPath = MappedDrive & DEPLOY_ARCHIVE &"\"& parPkg_name &"\"& parPkg_Version
|
|
|
458 |
objPkgFileSys.Archive_Path = TELNET_DEPLOY_ARCHIVE
|
|
|
459 |
|
|
|
460 |
'%%%%% Creation of Product folder is just temporary.
|
|
|
461 |
'%%%%% Remove the line objPkgFileSys.Create_Pkg_Folder parPkg_name, parPkg_version when depoly_archive is in production
|
|
|
462 |
objPkgFileSys.Create_Pkg_Folder parPkg_name, parPkg_Version
|
|
|
463 |
'%%%%% Remove line above ^^^^^^^^^^
|
|
|
464 |
|
|
|
465 |
Else
|
|
|
466 |
rootPath = MappedDrive & DPKG_ARCHIVE &"\"& parPkg_name &"\"& parPkg_Version
|
|
|
467 |
objPkgFileSys.Archive_Path = TELNET_DPKG_ARCHIVE
|
|
|
468 |
|
|
|
469 |
End If
|
|
|
470 |
objPkgFileSys.Ensure_Read_Write parPkg_name, parPkg_version ' Make sure all files and folders can be read
|
|
|
471 |
objPkgFileSys.Create_Doc_Folder parPkg_name, parPkg_Version, DOC_FOLDER ' Create document folder if required
|
|
|
472 |
|
|
|
473 |
' --------------- RELEASE NOTES ----------------
|
|
|
474 |
|
|
|
475 |
Select Case pkgType
|
|
|
476 |
Case enumPKG_TYPE_GENERIC_DPKG
|
|
|
477 |
Call Generate_Notes_Style_A ( parPv_id, notesSTR, parRtag_name, parProj_id )
|
|
|
478 |
|
|
|
479 |
Case enumPKG_TYPE_DB_PATCH_DPKG
|
|
|
480 |
Call Generate_Notes_Style_A ( parPv_id, notesSTR, parRtag_name, parProj_id )
|
|
|
481 |
|
|
|
482 |
Case enumPKG_TYPE_DEVICE_DPKG
|
|
|
483 |
Call Generate_Notes_Style_A ( parPv_id, notesSTR, parRtag_name, parProj_id )
|
|
|
484 |
|
|
|
485 |
Case enumPKG_TYPE_ERG_PRODUCT
|
|
|
486 |
Call Generate_Notes_Style_B ( parPv_id, notesSTR, parRtag_name, parProj_id )
|
|
|
487 |
|
|
|
488 |
Case Else
|
|
|
489 |
Call Generate_Notes_Style_A ( parPv_id, notesSTR, parRtag_name, parProj_id )
|
|
|
490 |
|
|
|
491 |
End Select
|
|
|
492 |
|
|
|
493 |
If WScript.Arguments.Named.Item("file") = "" Then
|
|
|
494 |
Call SaveFile( rootPath &"\"& DOC_FOLDER, Format_FileName( parPkg_name, parPkg_Version, parPv_id ) , notesSTR )
|
|
|
495 |
Else
|
|
|
496 |
Call SaveFile( AppPath &"temp", WScript.Arguments.Named.Item("file") , notesSTR )
|
|
|
497 |
End If
|
|
|
498 |
|
|
|
499 |
' ----------------------------------------------
|
|
|
500 |
|
|
|
501 |
End Sub
|
|
|
502 |
'-----------------------------------------------------------------------------------------------------------------
|
|
|
503 |
Function Format_CQ_CHANGE_REQUEST ( sInternal, sExternal )
|
|
|
504 |
If NOT IsNull( sInternal ) Then
|
|
|
505 |
If UCase( sInternal ) = "TRUE" AND UCase( sExternal ) = "TRUE" Then
|
|
|
506 |
Format_CQ_CHANGE_REQUEST = "Internal/External"
|
|
|
507 |
|
|
|
508 |
ElseIf UCase( sInternal ) = "TRUE" Then
|
|
|
509 |
Format_CQ_CHANGE_REQUEST = "Internal"
|
|
|
510 |
|
|
|
511 |
ElseIf UCase( sExternal) = "TRUE" Then
|
|
|
512 |
Format_CQ_CHANGE_REQUEST = "External"
|
|
|
513 |
|
|
|
514 |
Else
|
|
|
515 |
Format_CQ_CHANGE_REQUEST = "--"
|
|
|
516 |
|
|
|
517 |
End If
|
|
|
518 |
Else
|
|
|
519 |
Format_CQ_CHANGE_REQUEST = "--"
|
|
|
520 |
|
|
|
521 |
End If
|
|
|
522 |
End Function
|
|
|
523 |
'-----------------------------------------------------------------------------------------------------------------
|
|
|
524 |
Function Format_Reason_For_Release ( nIss_id, sReason )
|
|
|
525 |
If IsNull( nIss_id ) Then
|
|
|
526 |
If IsNull( sReason ) Then
|
|
|
527 |
Format_Reason_For_Release = "Reason for this version is not specified."
|
|
|
528 |
Else
|
|
|
529 |
Format_Reason_For_Release = FormatTextBox( HTML_Encode ( sReason ) )
|
|
|
530 |
End If
|
|
|
531 |
Else
|
|
|
532 |
If IsNull( sReason ) Then
|
|
|
533 |
Format_Reason_For_Release = ""
|
|
|
534 |
Else
|
|
|
535 |
Format_Reason_For_Release = FormatTextBox( HTML_Encode ( sReason ) )
|
|
|
536 |
End If
|
|
|
537 |
End If
|
|
|
538 |
End Function
|
|
|
539 |
'-----------------------------------------------------------------------------------------------------------------
|
|
|
540 |
Sub Get_Dependency_CQ_Issues ( SSsql, OOrsCQ, DDdepIss, AAiss )
|
|
|
541 |
Dim recCnt
|
|
|
542 |
If OOrsCQ.State = 1 Then
|
|
|
543 |
OOrsCQ.Close
|
|
|
544 |
End If
|
|
|
545 |
|
|
|
546 |
OOrsCQ.ActiveConnection = CQ_conn
|
|
|
547 |
OOrsCQ.Source = SSsql
|
|
|
548 |
OOrsCQ.CursorType = 0
|
|
|
549 |
OOrsCQ.CursorLocation = 2
|
|
|
550 |
OOrsCQ.LockType = 3
|
|
|
551 |
OOrsCQ.Open()
|
|
|
552 |
|
|
|
553 |
recCnt = 1
|
|
|
554 |
|
|
|
555 |
While ((NOT OOrsCQ.BOF) AND (NOT OOrsCQ.EOF))
|
|
|
556 |
ReDim Preserve AAiss( 20, recCnt )
|
|
|
557 |
DDdepIss.Add Cstr(OOrsCQ("iss_db") &"."& OOrsCQ("iss_id")), Cstr(recCnt)
|
|
|
558 |
AAiss( enumLoc_iss_db, recCnt ) = NVL( OOrsCQ("iss_db") )
|
|
|
559 |
AAiss( enumLoc_iss_id, recCnt ) = NVL( OOrsCQ("iss_id") )
|
|
|
560 |
AAiss( enumLoc_iss_num, recCnt ) = NVL( OOrsCQ("iss_num") )
|
|
|
561 |
AAiss( enumLoc_summary, recCnt ) = NVL( FormatTextBox ( HTML_Encode ( OOrsCQ("summary") ) ) )
|
|
|
562 |
AAiss( enumLoc_status, recCnt ) = NVL( OOrsCQ("status") )
|
|
|
563 |
AAiss( enumLoc_priority, recCnt ) = NVL( OOrsCQ("priority") )
|
|
|
564 |
AAiss( enumLoc_issue_type, recCnt ) = NVL( OOrsCQ("issue_type") )
|
|
|
565 |
AAiss( enumLoc_submitter, recCnt ) = NVL( OOrsCQ("submitter") )
|
|
|
566 |
AAiss( enumLoc_defect_in, recCnt ) = NVL( OOrsCQ("release_part1") &"."& OOrsCQ("release_part2") &"."& OOrsCQ("release_part3") )
|
|
|
567 |
AAiss( enumLoc_submit_date, recCnt ) = NVL( EuroDate ( OOrsCQ("submit_date") ) )
|
|
|
568 |
AAiss( enumLoc_project, recCnt ) = NVL( OOrsCQ("project") )
|
|
|
569 |
AAiss( enumLoc_owner, recCnt ) = NVL( OOrsCQ("owner") )
|
|
|
570 |
AAiss( enumLoc_product, recCnt ) = NVL( OOrsCQ("product") )
|
|
|
571 |
AAiss( enumLoc_approver, recCnt ) = NVL( OOrsCQ("approver") )
|
|
|
572 |
AAiss( enumLoc_package, recCnt ) = NVL( OOrsCQ("package_ref") )
|
|
|
573 |
AAiss( enumLoc_description, recCnt ) = NVL( FormatTextBox ( HTML_Encode ( OOrsCQ("description") ) ) )
|
|
|
574 |
AAiss( enumLoc_notes_log, recCnt ) = NVL( FormatTextBox ( HTML_Encode ( OOrsCQ("notes_log") ) ) )
|
|
|
575 |
AAiss( enumLoc_release_id, recCnt ) = NVL( OOrsCQ("release_id") )
|
|
|
576 |
AAiss( enumLoc_client_ref, recCnt ) = NVL( OOrsCQ("client_ref") )
|
|
|
577 |
AAiss( enumLoc_severity, recCnt ) = NVL( OOrsCQ("severity") )
|
|
|
578 |
AAiss( enumLoc_change_request, recCnt ) = Format_CQ_CHANGE_REQUEST ( OOrsCQ("cr_internal"), OOrsCQ("cr_external") )
|
|
|
579 |
|
|
|
580 |
recCnt = recCnt + 1
|
|
|
581 |
OOrsCQ.MoveNext
|
|
|
582 |
WEnd
|
|
|
583 |
|
|
|
584 |
OOrsCQ.Close
|
|
|
585 |
End Sub
|
|
|
586 |
'-----------------------------------------------------------------------------------------------------------------
|
|
|
587 |
Sub Get_ORA_Package_Issues ( SSstate, outCQSQL )
|
|
|
588 |
Dim rsTemp, sqlstr, DEVIiss, TDSEiss
|
|
|
589 |
|
|
|
590 |
Select Case SSstate
|
|
|
591 |
Case "Fixed_Issues"
|
|
|
592 |
sqlstr = " SELECT iss_db, iss_id, iss_state"&_
|
|
|
593 |
" FROM CQ_ISSUES "&_
|
|
|
594 |
" WHERE pv_id = "& parPv_id &_
|
|
|
595 |
" AND iss_state = "& enumISSUES_STATE_FIXED
|
|
|
596 |
Case "Outstanding_Issues"
|
|
|
597 |
sqlstr = " SELECT iss_db, iss_id, iss_state"&_
|
|
|
598 |
" FROM CQ_ISSUES "&_
|
|
|
599 |
" WHERE pv_id = "& parPv_id &_
|
|
|
600 |
" AND iss_state = "& enumISSUES_STATE_IMPORTED
|
|
|
601 |
Case "Dependency_Issues"
|
|
|
602 |
sqlstr = " SELECT iss_db, iss_id"&_
|
|
|
603 |
" FROM CQ_ISSUES "&_
|
|
|
604 |
" WHERE iss_state = "& enumISSUES_STATE_FIXED &_
|
|
|
605 |
" AND pv_id IN ( SELECT dpv_id FROM PACKAGE_DEPENDENCIES WHERE pv_id = "& parPv_id &" )"
|
|
|
606 |
End Select
|
|
|
607 |
|
|
|
608 |
Set rsTemp = OraDatabase.DbCreateDynaset( sqlstr, cint(0))
|
|
|
609 |
|
|
|
610 |
DEVIiss = "-1"
|
|
|
611 |
TDSEiss = "-1"
|
|
|
612 |
|
|
|
613 |
While ((NOT rsTemp.BOF) AND (NOT rsTemp.EOF))
|
|
|
614 |
If CInt(rsTemp("iss_db")) = CInt(enumCLEARQUEST_DEVI_ID) Then
|
|
|
615 |
DEVIiss = DEVIiss &","& rsTemp("iss_id")
|
|
|
616 |
|
|
|
617 |
ElseIf CInt(rsTemp("iss_db")) = CInt(enumCLEARQUEST_TDSE_ID) Then
|
|
|
618 |
TDSEiss = TDSEiss &","& rsTemp("iss_id")
|
|
|
619 |
|
|
|
620 |
End If
|
|
|
621 |
|
|
|
622 |
rsTemp.MoveNext
|
|
|
623 |
WEnd
|
|
|
624 |
|
|
|
625 |
' Construct SQL statement for CQ database
|
|
|
626 |
outCQSQL = ReadFile( AppPath & QUERIES_FOLDER & "\cq_issues_full.sql" )
|
|
|
627 |
outCQSQL = Replace( outCQSQL, "/*enumCLEARQUEST_DEVI_ID*/", enumCLEARQUEST_DEVI_ID)
|
|
|
628 |
outCQSQL = Replace( outCQSQL, "/*enumCLEARQUEST_TDSE_ID*/", enumCLEARQUEST_TDSE_ID)
|
|
|
629 |
outCQSQL = Replace( outCQSQL, "/*DEVIiss*/", DEVIiss)
|
|
|
630 |
outCQSQL = Replace( outCQSQL, "/*TDSEiss*/", TDSEiss)
|
|
|
631 |
|
|
|
632 |
rsTemp.Close
|
|
|
633 |
Set rsTemp = nothing
|
|
|
634 |
End Sub
|
|
|
635 |
'-----------------------------------------------------------------------------------------------------------------
|
|
|
636 |
Sub Get_JIRA_Package_Issues ( outJIRASQL )
|
|
|
637 |
Dim rsTemp, sqlstr, JIRAiss
|
|
|
638 |
|
|
|
639 |
sqlstr = " SELECT *"&_
|
|
|
640 |
" FROM JIRA_ISSUES"&_
|
|
|
641 |
" WHERE pv_id = "& parPv_id
|
|
|
642 |
|
|
|
643 |
Set rsTemp = OraDatabase.DbCreateDynaset( sqlstr, cint(0))
|
|
|
644 |
|
|
|
645 |
JIRAiss = "'-1'"
|
|
|
646 |
|
|
|
647 |
While ((NOT rsTemp.BOF) AND (NOT rsTemp.EOF))
|
|
|
648 |
JIRAiss = JIRAiss &",'"& rsTemp("iss_key")&"'"
|
|
|
649 |
rsTemp.MoveNext
|
|
|
650 |
WEnd
|
|
|
651 |
|
|
|
652 |
|
|
|
653 |
|
|
|
654 |
'Construct SQL statement for JIRA database
|
|
|
655 |
If Len(JIRAiss) <> 1 Then
|
|
|
656 |
outJIRASQL = "SELECT I.pkey AS iss_num, I.summary, ISS.pname AS state, IT.pname as IssueType, PR.pname as Priority, I.RESOLUTION "&_
|
|
|
657 |
" FROM jiraissue I, issuestatus ISS, issuetype IT, priority PR "&_
|
|
|
658 |
" WHERE I.pkey IN ("& JIRAIss &") "&_
|
|
|
659 |
" AND I.issuestatus = ISS.ID "&_
|
|
|
660 |
" AND IT.ID = I.issuetype "&_
|
|
|
661 |
" AND PR.ID = I.PRIORITY "
|
|
|
662 |
|
|
|
663 |
End If
|
|
|
664 |
|
|
|
665 |
rsTemp.Close
|
|
|
666 |
Set rsTemp = nothing
|
|
|
667 |
|
|
|
668 |
|
|
|
669 |
|
|
|
670 |
End Sub
|
|
|
671 |
'-----------------------------------------------------------------------------------------------------------------
|
|
|
672 |
Sub Get_CQ_Issues ( SSsql, OOrsCQ )
|
|
|
673 |
OOrsCQ.ActiveConnection = CQ_conn
|
|
|
674 |
OOrsCQ.Source = SSsql
|
|
|
675 |
OOrsCQ.CursorType = 0
|
|
|
676 |
OOrsCQ.CursorLocation = 2
|
|
|
677 |
OOrsCQ.LockType = 3
|
|
|
678 |
OOrsCQ.Open()
|
|
|
679 |
End Sub
|
|
|
680 |
'-----------------------------------------------------------------------------------------------------------------
|
|
|
681 |
Sub Get_JIRA_Issues ( SSsql, OOrsJIRA )
|
|
|
682 |
OOrsJIRA.ActiveConnection = "Provider=sqloledb;Data Source=auperatcm04;Initial Catalog=JIRA_341;User Id=jirauser;Password=jirauser"
|
|
|
683 |
OOrsJIRA.Source = SSsql
|
|
|
684 |
OOrsJIRA.CursorType = 0
|
|
|
685 |
OOrsJIRA.CursorLocation = 2
|
|
|
686 |
OOrsJIRA.LockType = 3
|
|
|
687 |
OOrsJIRA.Open()
|
|
|
688 |
End Sub
|
|
|
689 |
'-----------------------------------------------------------------------------------------------------------------
|
|
|
690 |
Sub EditReleaseInfoDetails ( nIssDB, nIssId, sNewInfo, sCurrentInfo )
|
|
|
691 |
Dim rsQry, Source, pos
|
|
|
692 |
|
|
|
693 |
If NOT IsNull(sCurrentInfo) Then
|
|
|
694 |
pos = InStr( sCurrentInfo, sNewInfo )
|
|
|
695 |
'Wscript.Echo pos
|
|
|
696 |
'Wscript.Echo Len(sCurrentInfo)
|
|
|
697 |
If pos = 0 Then
|
|
|
698 |
If Len(sCurrentInfo) = 0 Then
|
|
|
699 |
sCurrentInfo = sNewInfo
|
|
|
700 |
Else
|
|
|
701 |
sCurrentInfo = sCurrentInfo + VBNewLine + sNewInfo
|
|
|
702 |
End If
|
|
|
703 |
Else
|
|
|
704 |
sCurrentInfo = sCurrentInfo
|
|
|
705 |
End If
|
|
|
706 |
Else
|
|
|
707 |
sCurrentInfo = sNewInfo
|
|
|
708 |
End If
|
|
|
709 |
|
|
|
710 |
Wscript.Echo sCurrentInfo
|
|
|
711 |
|
|
|
712 |
Set rsQry = CreateObject("ADODB.Connection")
|
|
|
713 |
|
|
|
714 |
rsQry.Open CQ_conn
|
|
|
715 |
|
|
|
716 |
If CInt(nIssDB) = enumCLEARQUEST_DEVI_ID Then
|
|
|
717 |
Source = "EXEC devi_prod.dbo.sp_RM_editReleaseInfoDetails "& nIssId &", '"& sCurrentInfo &"';"
|
|
|
718 |
rsQry.Execute Source
|
|
|
719 |
End If
|
|
|
720 |
|
|
|
721 |
'On Error Resume Next
|
|
|
722 |
|
|
|
723 |
|
|
|
724 |
|
|
|
725 |
rsQry.Close()
|
|
|
726 |
Set rsQry = nothing
|
|
|
727 |
End Sub
|
|
|
728 |
'-----------------------------------------------------------------------------------------------------------------
|
|
|
729 |
'-------------------- MAIN LINE ----------------------
|
|
|
730 |
WScript.Echo "==================== job:GenerateReleaseNotes ===================="
|
|
|
731 |
|
|
|
732 |
Set objArgs = WScript.Arguments
|
|
|
733 |
|
|
|
734 |
If (objArgs.Unnamed.Count > 0) Then
|
|
|
735 |
Wscript.Echo "ERROR: Unnamed parameters!"
|
|
|
736 |
objArgs.ShowUsage
|
|
|
737 |
WScript.Quit
|
|
|
738 |
|
|
|
739 |
Else
|
|
|
740 |
parPkg_name = objArgs.Named.Item("pkg_name")
|
|
|
741 |
parPkg_Version = objArgs.Named.Item("pkg_version")
|
|
|
742 |
parPv_id = objArgs.Named.Item("pv_id")
|
|
|
743 |
parRtag_name = objArgs.Named.Item("rtag_name")
|
|
|
744 |
parProj_id = objArgs.Named.Item("proj_id")
|
|
|
745 |
|
|
|
746 |
If ( parPkg_name <> "" AND parPkg_Version <> "") Then
|
|
|
747 |
Call Get_PV_ID ( parPkg_name, parPkg_Version, parPv_id )
|
|
|
748 |
|
|
|
749 |
ElseIf parPv_id <> "" Then
|
|
|
750 |
Call Get_Pkg_Name_Version ( parPv_id, parPkg_name, parPkg_Version )
|
|
|
751 |
|
|
|
752 |
Else
|
|
|
753 |
objArgs.ShowUsage
|
|
|
754 |
WScript.Quit
|
|
|
755 |
|
|
|
756 |
End If
|
|
|
757 |
|
|
|
758 |
End If
|
|
|
759 |
|
|
|
760 |
Call Check_Requirements_To_Proceed ( parPv_id )
|
|
|
761 |
Call Generate_Release_Notes ()
|
|
|
762 |
|
|
|
763 |
WScript.Echo "Release Notes generated successfully!"
|
|
|
764 |
]]>
|
|
|
765 |
</script>
|
|
|
766 |
</job>
|
|
|
767 |
<job id="PostRun" args="/pv_id:30261 /f:Y" prompt="no">
|
|
|
768 |
<?job error="true" debug="true" ?>
|
|
|
769 |
<runtime>
|
|
|
770 |
<named helpstring="Package Name" name="pkg_name" required="false" type="string"/>
|
|
|
771 |
<named helpstring="Package Version" name="pkg_version" required="false" type="string"/>
|
|
|
772 |
<named helpstring="Package primary key" name="pv_id" required="false" type="simple"/>
|
|
|
773 |
<named helpstring="Force Release Notes Generation" name="f" required="false" type="string"/>
|
|
|
774 |
<usage>
|
|
|
775 |
Usage:
|
|
|
776 |
on_Make_Official.wsf [/pkg_name:value] [/pkg_version:value]
|
|
|
777 |
OR
|
|
|
778 |
on_Make_Official.wsf [/pv_id:value]
|
|
|
779 |
|
|
|
780 |
Options:
|
|
|
781 |
|
|
|
782 |
pkg_name : Package Name
|
|
|
783 |
pkg_version : Package Version
|
|
|
784 |
pv_id : Package Version primary key
|
|
|
785 |
</usage>
|
|
|
786 |
</runtime>
|
|
|
787 |
<object id="Oracle_Objects_For_OLE" progid="OracleInProcServer.XOraSession" events="true"/>
|
|
|
788 |
<script language="VBScript" src="common_subs.vbs"/>
|
|
|
789 |
<script language="VBScript" src="config.vbs"/>
|
|
|
790 |
<script language="VBScript" src="pkg_archive.vbs"/>
|
|
|
791 |
<script id="PostRun" language="VBScript">
|
|
|
792 |
<![CDATA[
|
|
|
793 |
Option Explicit
|
|
|
794 |
'=====================================================
|
|
|
795 |
' Name: PostRun
|
|
|
796 |
' Description: Process ran after the release notes
|
|
|
797 |
' have been generated.
|
|
|
798 |
' INPUT: pkg_name
|
|
|
799 |
' pkg_version
|
|
|
800 |
'=====================================================
|
|
|
801 |
|
|
|
802 |
'================ Variable Definition ================
|
|
|
803 |
Dim objArgs
|
|
|
804 |
Dim parPv_id
|
|
|
805 |
Dim parPkg_name
|
|
|
806 |
Dim parRtag_name
|
|
|
807 |
Dim parProj_id
|
|
|
808 |
Dim parPkg_Version
|
|
|
809 |
Dim objPkgFileSys
|
|
|
810 |
Dim rootPath
|
|
|
811 |
Dim notesLocation
|
|
|
812 |
'=============== Constants Declaration ===============
|
|
|
813 |
'================== Variable Init ====================
|
|
|
814 |
Set objPkgFileSys = New PkgArchive
|
|
|
815 |
'=====================================================
|
|
|
816 |
'-----------------------------------------------------------------------------------------------------------------
|
|
|
817 |
Sub Move_Files_From_Web_Archive ()
|
|
|
818 |
Dim oFileSys, sPath, sSourcePath, sDestPath
|
|
|
819 |
Set oFileSys = CreateObject("Scripting.FileSystemObject")
|
|
|
820 |
|
|
|
821 |
|
|
|
822 |
' Move doc folder contents
|
|
|
823 |
sSourcePath = AppPath & TEMP_FOLDER &"\"& parPkg_name &"\"& parPkg_Version &"\"& DOC_FOLDER
|
|
|
824 |
sDestPath = rootPath &"\"& DOC_FOLDER
|
|
|
825 |
|
|
|
826 |
If oFileSys.FolderExists( sSourcePath ) Then
|
|
|
827 |
WScript.Echo "Moving attachments from Web Server..."
|
|
|
828 |
On Error Resume Next
|
|
|
829 |
|
|
|
830 |
oFileSys.CopyFile sSourcePath &"\*", sDestPath, True ' Copy with overwrite
|
|
|
831 |
Call ErrorCheck ( "[job:PostRun sub:Move_Files_From_Web_Archive]", _
|
|
|
832 |
"sSourcePath: "& sSourcePath & VBNewLine &_
|
|
|
833 |
"sDestPath: "& sDestPath )
|
|
|
834 |
|
|
|
835 |
oFileSys.DeleteFolder sSourcePath, True ' Clean up
|
|
|
836 |
'Call ErrorCheck ( "[job:PostRun sub:Move_Files_From_Web_Archive]", _
|
|
|
837 |
' "Delete Folder: "& sSourcePath )
|
|
|
838 |
|
|
|
839 |
End If
|
|
|
840 |
|
|
|
841 |
Call CleanUp_Folders ( AppPath & TEMP_FOLDER )
|
|
|
842 |
|
|
|
843 |
End Sub
|
|
|
844 |
'-----------------------------------------------------------------------------------------------------------------
|
|
|
845 |
Sub CleanUp_Folders ( sPath )
|
|
|
846 |
Dim currentFolder
|
|
|
847 |
' Attempt to remove PKG_NAME/PKG_VERSION folders on web server
|
|
|
848 |
WScript.Echo "Cleaning temp files/folders at Web Server..."
|
|
|
849 |
On Error Resume Next
|
|
|
850 |
|
|
|
851 |
' Attempting to remove PKG_VERSION/
|
|
|
852 |
currentFolder = sPath &"\"& parPkg_name &"\"& parPkg_version
|
|
|
853 |
If Folder_Is_Empty ( currentFolder ) Then
|
|
|
854 |
Call DeleteFolder( currentFolder )
|
|
|
855 |
'Else
|
|
|
856 |
' Call Raise_Event ( enumEVENT_WARNING, "[job:PostRun sub:CleanUp_Folders]", _
|
|
|
857 |
' "Deleting Folder: "& currentFolder , _
|
|
|
858 |
' "PKG_VERSION Folder is not empty and is not removed! Skipping this process.", NULL )
|
|
|
859 |
End If
|
|
|
860 |
|
|
|
861 |
Call ErrorCheck ( "[job:PostRun sub:CleanUp_Folders]", _
|
|
|
862 |
"Delete Folder: "& currentFolder )
|
|
|
863 |
|
|
|
864 |
|
|
|
865 |
|
|
|
866 |
' Attempting to remove PKG_NAME/
|
|
|
867 |
currentFolder = sPath &"\"& parPkg_name
|
|
|
868 |
If Folder_Is_Empty ( currentFolder ) Then
|
|
|
869 |
Call DeleteFolder( currentFolder )
|
|
|
870 |
'Else
|
|
|
871 |
' Call Raise_Event ( enumEVENT_WARNING, "[job:PostRun sub:CleanUp_Folders]", _
|
|
|
872 |
' "Deleting Folder: "& currentFolder , _
|
|
|
873 |
' "PKG_NAME Folder is not empty and is not removed! Skipping this process.", NULL )
|
|
|
874 |
End If
|
|
|
875 |
|
|
|
876 |
Call ErrorCheck ( "[job:PostRun sub:CleanUp_Folders]", _
|
|
|
877 |
"Delete Folder: "& currentFolder )
|
|
|
878 |
|
|
|
879 |
End Sub
|
|
|
880 |
'-----------------------------------------------------------------------------------------------------------------
|
|
|
881 |
Sub Initial_Setup ( oPkgFileSys, sRootPath, sNotesLocation )
|
|
|
882 |
Dim MappedDrive, nPkgType
|
|
|
883 |
oPkgFileSys.Map_Network_Drive UNC_ARCHIVE, MappedDrive ' Map Drive if required
|
|
|
884 |
nPkgType = Get_Package_Type ( parPv_id )
|
|
|
885 |
|
|
|
886 |
oPkgFileSys.Remote_Host = TELNET_MACHINE
|
|
|
887 |
If nPkgType = enumPKG_TYPE_ERG_PRODUCT Then
|
|
|
888 |
sNotesLocation = URL_PATH_DEPLOY_ARCHIVE &"/"& parPkg_name &"/"& parPkg_Version &"/"& DOC_FOLDER &"/"& Format_FileName( parPkg_name, parPkg_Version, parPv_id )
|
|
|
889 |
sRootPath = MappedDrive & DEPLOY_ARCHIVE &"\"& parPkg_name &"\"& parPkg_Version
|
|
|
890 |
oPkgFileSys.Archive_Path = TELNET_DEPLOY_ARCHIVE
|
|
|
891 |
|
|
|
892 |
'%%%%% Creation of Product folder is just temporary.
|
|
|
893 |
'%%%%% Remove the line objPkgFileSys.Create_Pkg_Folder parPkg_name, parPkg_version when depoly_archive is in production
|
|
|
894 |
oPkgFileSys.Create_Pkg_Folder parPkg_name, parPkg_Version
|
|
|
895 |
'%%%%% Remove line above ^^^^^^^^^^
|
|
|
896 |
|
|
|
897 |
Else
|
|
|
898 |
sNotesLocation = URL_PATH_DPKG_ARCHIVE &"/"& parPkg_name &"/"& parPkg_Version &"/"& DOC_FOLDER &"/"& Format_FileName( parPkg_name, parPkg_Version, parPv_id )
|
|
|
899 |
sRootPath = MappedDrive & DPKG_ARCHIVE &"\"& parPkg_name &"\"& parPkg_Version
|
|
|
900 |
oPkgFileSys.Archive_Path = TELNET_DPKG_ARCHIVE
|
|
|
901 |
|
|
|
902 |
End If
|
|
|
903 |
objPkgFileSys.Ensure_Read_Write parPkg_name, parPkg_version ' Make sure all files and folders can be read
|
|
|
904 |
oPkgFileSys.Create_Doc_Folder parPkg_name, parPkg_Version, DOC_FOLDER ' Create document folder if required
|
|
|
905 |
|
|
|
906 |
End Sub
|
|
|
907 |
'-----------------------------------------------------------------------------------------------------------------
|
|
|
908 |
'-------------------- MAIN LINE ----------------------
|
|
|
909 |
WScript.Echo "==================== job:PostRun ===================="
|
|
|
910 |
|
|
|
911 |
Set objArgs = WScript.Arguments
|
|
|
912 |
|
|
|
913 |
If (objArgs.Unnamed.Count > 0) Then
|
|
|
914 |
Wscript.Echo "ERROR: Unnamed parameters!"
|
|
|
915 |
objArgs.ShowUsage
|
|
|
916 |
WScript.Quit
|
|
|
917 |
|
|
|
918 |
Else
|
|
|
919 |
parPkg_name = objArgs.Named.Item("pkg_name")
|
|
|
920 |
parPkg_Version = objArgs.Named.Item("pkg_version")
|
|
|
921 |
parPv_id = objArgs.Named.Item("pv_id")
|
|
|
922 |
parRtag_name = objArgs.Named.Item("rtag_name")
|
|
|
923 |
parProj_id = objArgs.Named.Item("proj_id")
|
|
|
924 |
|
|
|
925 |
If ( parPkg_name <> "" AND parPkg_Version <> "") Then
|
|
|
926 |
Call Get_PV_ID ( parPkg_name, parPkg_Version, parPv_id )
|
|
|
927 |
|
|
|
928 |
ElseIf parPv_id <> "" Then
|
|
|
929 |
Call Get_Pkg_Name_Version ( parPv_id, parPkg_name, parPkg_Version )
|
|
|
930 |
|
|
|
931 |
Else
|
|
|
932 |
objArgs.ShowUsage
|
|
|
933 |
WScript.Quit
|
|
|
934 |
|
|
|
935 |
End If
|
|
|
936 |
|
|
|
937 |
End If
|
|
|
938 |
|
|
|
939 |
Call Check_Requirements_To_Proceed ( parPv_id )
|
|
|
940 |
Call Initial_Setup ( objPkgFileSys, rootPath, notesLocation )
|
|
|
941 |
|
|
|
942 |
Call Move_Files_From_Web_Archive ()
|
|
|
943 |
|
|
|
944 |
WScript.Echo "Making all READ ONLY from folder "& parPkg_Version &"/"
|
|
|
945 |
objPkgFileSys.All_Read_Only parPkg_name, parPkg_Version ' Make sure all file and folders are read only. Starting from version folder.
|
|
|
946 |
|
|
|
947 |
Call Write_To_Release_Notes_Info ( parPv_id, notesLocation )
|
|
|
948 |
|
|
|
949 |
Set objPkgFileSys = Nothing
|
|
|
950 |
|
|
|
951 |
WScript.Echo "PostRun completed successfully!"
|
|
|
952 |
]]>
|
|
|
953 |
</script>
|
|
|
954 |
</job>
|
|
|
955 |
</package>
|