You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

63 lines
2.1KB

  1. Option Explicit
  2. Dim DeployMachine:DeployMachine = "KCI-APP01"
  3. Dim DeployRoot:DeployRoot = "F:\Development\Tracking_Kits\CiCd\" '"C:\inetpub\wwwroot\"
  4. Dim fso:Set fso = WScript.CreateObject("Scripting.Filesystemobject")
  5. Dim WshShell:Set WshShell = WScript.CreateObject("Wscript.Shell")
  6. Dim objShell:Set objShell = CreateObject("Shell.Application")
  7. If fso.FolderExists(DeployRoot & "test") Then
  8. WshShell.Run "cmd.exe /c rmdir /s /q """ & DeployRoot & "test""" , 0,True
  9. End If
  10. CloneRepo
  11. ZipRepo
  12. fso.CopyFile DeployRoot & "zzip.zip", "\\KCI-SYN-CL01\PC Transfer\zzip.zip", True
  13. WshShell.CurrentDirectory = DeployRoot
  14. Cleanup
  15. Sub Cleanup
  16. WshShell.Run "cmd.exe /c rmdir /s /q """ & DeployRoot & "test\""" , 0,True
  17. WScript.Sleep 2500
  18. WScript.Sleep 2500
  19. ' fso.DeleteFolder DeployRoot & "test"
  20. WshShell.Run "cmd.exe /c rmdir """ & DeployRoot & "test""" , 0,True
  21. fso.DeleteFile DeployRoot & "\zzip.zip"
  22. End Sub
  23. Sub ZipRepo
  24. WScript.Sleep 2500
  25. WScript.Sleep 2500
  26. fso.OpenTextFile(DeployRoot & "zzip.zip", 2, True).Write "PK" & Chr(5) & Chr(6) _
  27. & String(18, Chr(0))
  28. WScript.Sleep 2500
  29. WScript.Sleep 2500
  30. Dim objZip
  31. Set objZip = objShell.NameSpace(DeployRoot & "zzip.zip")
  32. Dim objFolder:Set objFolder = objShell.NameSpace(DeployRoot & "test\")
  33. objZip.CopyHere objFolder.Items
  34. Do Until objZip.Items.Count = objFolder.Items.Count
  35. WScript.Sleep 200
  36. Loop
  37. Set objFolder = nothing
  38. End Sub
  39. Sub CloneRepo
  40. WshShell.Exec("git init test")
  41. WScript.Sleep 2500
  42. WshShell.CurrentDirectory = DeployRoot & "test"
  43. WshShell.Exec("git remote add -f origin https://dcovington:_3ggUSA6YELP@onefortheroadgit.sytes.net/dcovington/tracking_kits")
  44. WshShell.Exec("git config core.sparseCheckout true")
  45. Dim objFile
  46. Set objFile = fso.CreateTextFile(".git/info/sparse-checkout")
  47. objFile.WriteLine("App/")
  48. objFile.WriteLine("Data/arrow ne.jpg")
  49. objFile.WriteLine("Data/Label_Report.rep")
  50. objFile.WriteLine("Data/png-transparent-arrow-arrow-angle-triangle-black-thumbnail.jpg")
  51. objFile.WriteLine("dist/")
  52. objFile.WriteLine("MVC/")
  53. objFile.WriteLine("index.asp")
  54. WshShell.Exec("git pull origin master")
  55. End Sub

Powered by TurnKey Linux.