Subversion Repositories DevTools

Rev

Rev 4624 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4624 Rev 5097
Line 3... Line 3...
3
'                release_changed.asp
3
'                release_changed.asp
4
'=====================================================
4
'=====================================================
5
%>
5
%>
6
<%
6
<%
7
' Release Change Mode
7
' Release Change Mode
8
Const enumRELEASE_CHANGE_MODE_PKG_ADDED = 1 'Package added to release
8
Const enumRELEASE_CHANGE_MODE_PKG_ADDED = 1     'Package added to release
9
Const enumRELEASE_CHANGE_MODE_PKG_REMOVED = 2 'Package removed from release
9
Const enumRELEASE_CHANGE_MODE_PKG_REMOVED = 2   'Package removed from release
10
Const enumRELEASE_CHANGE_MODE_PKG_RELEASED = 3 'Package released
10
Const enumRELEASE_CHANGE_MODE_PKG_RELEASED = 3  'Package released
11
 
11
 
12
 
12
 
13
Class ReleaseChanged
13
Class ReleaseChanged
14
 
14
 
15
private m_pkg_name
15
private m_pkg_name
16
private m_pkg_version
16
private m_pkg_version
17
private m_pkg_id
17
private m_pkg_id
18
private m_proj_id
18
private m_proj_id
19
 
19
 
-
 
20
' Archive server name and credentials
-
 
21
'   Perhaps the credentials should come from the environment
-
 
22
private m_archive_server
-
 
23
private m_archive_user
-
 
24
private m_archive_password
-
 
25
 
-
 
26
Public last_resultCode
-
 
27
 
-
 
28
'-----------------------------------------------------------------------------------------------------------------
-
 
29
'   Retrieve information about the target server
-
 
30
'
-
 
31
Private Sub Get_Server_Info()
-
 
32
    m_archive_user = "releasem"    
-
 
33
    m_archive_password = "releasem"
-
 
34
 
-
 
35
    Dim sqry: sqry = "SELECT * FROM BUILD_SERVICE_CONFIG WHERE SERVICE='ARCHIVE SERVER'"
-
 
36
    Dim rsTemp
-
 
37
    Set rsTemp = OraDatabase.DbCreateDynaset( sqry , cint(0) )
-
 
38
    m_archive_server = rsTemp("config")
-
 
39
    rsTemp.Close()
-
 
40
    Set rsTemp = Nothing
-
 
41
End Sub
-
 
42
 
20
'-----------------------------------------------------------------------------------------------------------------
43
'-----------------------------------------------------------------------------------------------------------------
21
' Retrieves package infomation for the specified package version
44
' Retrieves package infomation for the specified package version
22
' This information is required for the make_release_changed script
45
' This information is required for the make_release_changed script
23
Public Sub Get_Package_Info (artag_id,apv_id)
46
Public Sub Get_Package_Info (artag_id,apv_id)
24
   Dim ssql, rsTemp
47
   Dim ssql, rsTemp
Line 76... Line 99...
76
  '
99
  '
77
  Call sysSHell.Run("cmd.exe /c cscript.exe //B //NoLogo " & rootPath & SCRIPTS_FOLDER &"\on_Make_Official.wsf //job:ReleaseChanged" & " /pkg_name:""" & m_pkg_name & """" & " /pkg_version:""" & m_pkg_version & """" & " /rtag_id:" & artag_id & " /pkg_id:" & m_pkg_id & " /pv_id:" & apv_id & " /proj_id:" & m_proj_id & " /mode_id:" & amode_id, 0, True)
100
  Call sysSHell.Run("cmd.exe /c cscript.exe //B //NoLogo " & rootPath & SCRIPTS_FOLDER &"\on_Make_Official.wsf //job:ReleaseChanged" & " /pkg_name:""" & m_pkg_name & """" & " /pkg_version:""" & m_pkg_version & """" & " /rtag_id:" & artag_id & " /pkg_id:" & m_pkg_id & " /pv_id:" & apv_id & " /proj_id:" & m_proj_id & " /mode_id:" & amode_id, 0, True)
78
  Set sysShell = Nothing
101
  Set sysShell = Nothing
79
End Sub
102
End Sub
80
 
103
 
-
 
104
'-----------------------------------------------------------------------------------------------------------------
-
 
105
' Uses ssh to communicate with the archive server and run the unix script, make_release_changed
-
 
106
'   Current Issue: Does not have nice error reporting mechanism
-
 
107
'
-
 
108
Sub Run_ReleaseChanged_New_and_not_yet_used(artag_id,apv_id,amode_id,aget_info)
-
 
109
    Dim sudoCmd, plinkPath, plinkCmd, wCmdLine
-
 
110
 
-
 
111
  last_resultCode = -1
-
 
112
  Call Get_Server_Info
-
 
113
  if aget_info then
-
 
114
    Call Get_Package_Info (artag_id,apv_id)
-
 
115
  end if
-
 
116
 
-
 
117
  '
-
 
118
  ' Build up the command line to the target script
-
 
119
  '
-
 
120
    sudoCmd = "~/sbin/make_release_changed" &_
-
 
121
         " archive=dpkg_archive" &_
-
 
122
         " pkg_name='\""" & m_pkg_name & "\""'" &_
-
 
123
         " pkg_version='\"""& m_pkg_version &"\""'" &_
-
 
124
         " rtag_id="& artag_id &_
-
 
125
         " pkg_id=" & m_pkg_id &_
-
 
126
         " pv_id="& apv_id &_
-
 
127
         " proj_id="& m_proj_id &_
-
 
128
         " mode_id="& amode_id
-
 
129
 
-
 
130
    ' Build up the ssh command
-
 
131
    plinkPath = Request.ServerVariables("APPL_PHYSICAL_PATH") & "Release_Manager\scripts\bin\plink.exe"
-
 
132
    plinkCmd =  "-ssh -batch " & m_archive_user & "@" & m_archive_server & " -pw " & m_archive_password & " ""sudo " & sudoCmd & ";"""
-
 
133
    wCmdLine =  plinkPath & " " & plinkCmd
-
 
134
   
-
 
135
    ' Note: Call Run such that we wait for the result code
-
 
136
    '       If we don't do this then we may flood the server with requests and then it jams up.
-
 
137
    '
-
 
138
    Dim objWSH
-
 
139
    Set objWSH = Server.CreateObject("WScript.Shell")
-
 
140
    last_resultCode = objWSH.Run (wCmdLine, 0, TRUE)
-
 
141
    Set objWSH = Nothing
-
 
142
 
-
 
143
End Sub
-
 
144
 
81
'-----------------------------------------------------------------------------------------------------------------------------
145
'-----------------------------------------------------------------------------------------------------------------------------
82
' Get the package are in which the package version resides (ie wip, planned, released)
146
' Get the package are in which the package version resides (ie wip, planned, released)
83
Function Get_Pkg_Area (artagId, apvId)
147
Function Get_Pkg_Area (artagId, apvId)
84
   OraDatabase.Parameters.Add "RTAG_ID",        artagId,                 ORAPARM_INPUT, ORATYPE_NUMBER
148
   OraDatabase.Parameters.Add "RTAG_ID",        artagId,                 ORAPARM_INPUT, ORATYPE_NUMBER
85
   OraDatabase.Parameters.Add "PV_ID",          apvId,                   ORAPARM_INPUT, ORATYPE_NUMBER
149
   OraDatabase.Parameters.Add "PV_ID",          apvId,                   ORAPARM_INPUT, ORATYPE_NUMBER