|
@@ -1,27 +1,38 @@ |
|
|
Option Explicit |
|
|
Option Explicit |
|
|
Dim DeployMachine:DeployMachine = "KCI-APP01" |
|
|
Dim DeployMachine:DeployMachine = "KCI-APP01" |
|
|
|
|
|
Dim remoteDeployPath:remoteDeployPath = "C:\inetpub\tracking" |
|
|
|
|
|
Dim ScriptDirectory:ScriptDirectory = Replace(WScript.ScriptFullName,WScript.ScriptName,"") |
|
|
Dim DeployRoot:DeployRoot = "F:\Development\Tracking_Kits\CiCd\" '"C:\inetpub\wwwroot\" |
|
|
Dim DeployRoot:DeployRoot = "F:\Development\Tracking_Kits\CiCd\" '"C:\inetpub\wwwroot\" |
|
|
|
|
|
|
|
|
Dim fso:Set fso = WScript.CreateObject("Scripting.Filesystemobject") |
|
|
Dim fso:Set fso = WScript.CreateObject("Scripting.Filesystemobject") |
|
|
Dim WshShell:Set WshShell = WScript.CreateObject("Wscript.Shell") |
|
|
Dim WshShell:Set WshShell = WScript.CreateObject("Wscript.Shell") |
|
|
Dim objShell:Set objShell = CreateObject("Shell.Application") |
|
|
Dim objShell:Set objShell = CreateObject("Shell.Application") |
|
|
|
|
|
|
|
|
|
|
|
Dim transferFolder:transferFolder = "\\KCI-SYN-CL01\PC Transfer\" |
|
|
If fso.FolderExists(DeployRoot & "test") Then |
|
|
If fso.FolderExists(DeployRoot & "test") Then |
|
|
WshShell.Run "cmd.exe /c rmdir /s /q """ & DeployRoot & "test""" , 0,True |
|
|
WshShell.Run "cmd.exe /c rmdir /s /q """ & DeployRoot & "test""" , 0,True |
|
|
End If |
|
|
End If |
|
|
|
|
|
|
|
|
CloneRepo |
|
|
CloneRepo |
|
|
ZipRepo |
|
|
ZipRepo |
|
|
fso.CopyFile DeployRoot & "zzip.zip", "\\KCI-SYN-CL01\PC Transfer\zzip.zip", True |
|
|
|
|
|
WshShell.CurrentDirectory = DeployRoot |
|
|
|
|
|
Cleanup |
|
|
Cleanup |
|
|
|
|
|
Deploy |
|
|
|
|
|
|
|
|
|
|
|
Sub Deploy |
|
|
|
|
|
Debug.WriteLine ScriptDirectory & "PsExec64.exe -i \\" & DeployMachine & " -u ntp\daniel_admin -p BarkHornSlam4* cmd.exe copy """ & _ |
|
|
|
|
|
transferFolder & "zzip.zip"" " & """" & remoteDeployPath & "\zzip.zip""" & " & tar -xf ""C:\inetpub\tracking\zip.zip"" -C ""C:\inetpub\tracking""" |
|
|
|
|
|
|
|
|
|
|
|
WshShell.Run ScriptDirectory & "PsExec64.exe -i \\" & DeployMachine & " -u ntp\daniel_admin -p BarkHornSlam4* cmd.exe /C copy """ & _ |
|
|
|
|
|
transferFolder & "\zzip.zip"" " & """" & remoteDeployPath & "\zip.zip""" & " & tar -xf ""C:\inetpub\tracking\zip.zip"" -C ""C:\inetpub\tracking""",1,True |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
End Sub |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Sub Cleanup |
|
|
Sub Cleanup |
|
|
|
|
|
WshShell.CurrentDirectory = DeployRoot |
|
|
WshShell.Run "cmd.exe /c rmdir /s /q """ & DeployRoot & "test\""" , 0,True |
|
|
WshShell.Run "cmd.exe /c rmdir /s /q """ & DeployRoot & "test\""" , 0,True |
|
|
WScript.Sleep 2500 |
|
|
WScript.Sleep 2500 |
|
|
WScript.Sleep 2500 |
|
|
WScript.Sleep 2500 |
|
|
' fso.DeleteFolder DeployRoot & "test" |
|
|
|
|
|
WshShell.Run "cmd.exe /c rmdir """ & DeployRoot & "test""" , 0,True |
|
|
|
|
|
fso.DeleteFile DeployRoot & "\zzip.zip" |
|
|
fso.DeleteFile DeployRoot & "\zzip.zip" |
|
|
|
|
|
|
|
|
End Sub |
|
|
End Sub |
|
@@ -41,6 +52,7 @@ Sub ZipRepo |
|
|
Do Until objZip.Items.Count = objFolder.Items.Count |
|
|
Do Until objZip.Items.Count = objFolder.Items.Count |
|
|
WScript.Sleep 200 |
|
|
WScript.Sleep 200 |
|
|
Loop |
|
|
Loop |
|
|
|
|
|
fso.CopyFile DeployRoot & "zzip.zip", transferFolder & "zzip.zip", True |
|
|
Set objFolder = nothing |
|
|
Set objFolder = nothing |
|
|
End Sub |
|
|
End Sub |
|
|
|
|
|
|
|
|