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