|  | Option Explicit
Dim DeployMachine:DeployMachine = "KCI-APP01"
Dim DeployRoot:DeployRoot = "F:\Development\Tracking_Kits\CiCd\" '"C:\inetpub\wwwroot\"
Dim fso:Set fso = WScript.CreateObject("Scripting.Filesystemobject")
Dim WshShell:Set WshShell = WScript.CreateObject("Wscript.Shell")
Dim objShell:Set objShell = CreateObject("Shell.Application")
If fso.FolderExists(DeployRoot & "test") Then
	WshShell.Run "cmd.exe /c rmdir /s /q """ & DeployRoot & "test""" , 0,True
End If
CloneRepo
ZipRepo
fso.CopyFile DeployRoot & "zzip.zip", "\\KCI-SYN-CL01\PC Transfer\zzip.zip", True
WshShell.CurrentDirectory = DeployRoot
Cleanup
Sub Cleanup
	WshShell.Run "cmd.exe /c rmdir /s /q """ & DeployRoot & "test\""" , 0,True
	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"
End Sub 
Sub ZipRepo
	WScript.Sleep 2500
	WScript.Sleep 2500
	fso.OpenTextFile(DeployRoot & "zzip.zip", 2, True).Write "PK" & Chr(5) & Chr(6) _
	  & String(18, Chr(0))
	  WScript.Sleep 2500
	WScript.Sleep 2500
	Dim objZip
	Set objZip = objShell.NameSpace(DeployRoot & "zzip.zip")
	Dim objFolder:Set objFolder = objShell.NameSpace(DeployRoot & "test\")
	
	objZip.CopyHere objFolder.Items 
	Do Until objZip.Items.Count = objFolder.Items.Count
	    WScript.Sleep 200
	Loop
	Set objFolder = nothing
End Sub
Sub CloneRepo
	WshShell.Exec("git init test")
	WScript.Sleep 2500
	WshShell.CurrentDirectory = DeployRoot & "test"
	WshShell.Exec("git remote add -f origin https://dcovington:_3ggUSA6YELP@onefortheroadgit.sytes.net/dcovington/tracking_kits")
	WshShell.Exec("git config core.sparseCheckout true")
	Dim objFile
	Set objFile = fso.CreateTextFile(".git/info/sparse-checkout")
	objFile.WriteLine("App/")
	objFile.WriteLine("Data/arrow ne.jpg")
	objFile.WriteLine("Data/Label_Report.rep")
	objFile.WriteLine("Data/png-transparent-arrow-arrow-angle-triangle-black-thumbnail.jpg")
	objFile.WriteLine("dist/")
	objFile.WriteLine("MVC/")
	objFile.WriteLine("index.asp")
	WshShell.Exec("git pull origin master")
End Sub 
 |