Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

pirms 10 mēnešiem
pirms 10 mēnešiem
pirms 10 mēnešiem
pirms 10 mēnešiem
pirms 10 mēnešiem
pirms 10 mēnešiem
pirms 10 mēnešiem
pirms 10 mēnešiem
pirms 10 mēnešiem
pirms 10 mēnešiem
pirms 10 mēnešiem
pirms 10 mēnešiem
pirms 10 mēnešiem
pirms 10 mēnešiem
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. Option Explicit
  2. Dim DeployMachine:DeployMachine = "KCI-APP01"
  3. Dim remoteDeployPath:remoteDeployPath = "C:\inetpub\tracking"
  4. Dim ScriptDirectory:ScriptDirectory = Replace(WScript.ScriptFullName,WScript.ScriptName,"")
  5. Dim DeployRoot:DeployRoot = "F:\Development\Tracking_Kits\CiCd\" '"C:\inetpub\wwwroot\"
  6. Dim fso:Set fso = WScript.CreateObject("Scripting.Filesystemobject")
  7. Dim WshShell:Set WshShell = WScript.CreateObject("Wscript.Shell")
  8. Dim objShell:Set objShell = CreateObject("Shell.Application")
  9. Dim transferFolder:transferFolder = "\\KCI-SYN-CL01\PC Transfer\"
  10. If fso.FolderExists(DeployRoot & "test") Then
  11. WshShell.Run "cmd.exe /c rmdir /s /q """ & DeployRoot & "test""" , 0,True
  12. End If
  13. CloneRepo
  14. ZipRepo
  15. Cleanup
  16. Deploy
  17. Sub Deploy
  18. Debug.WriteLine ScriptDirectory & "PsExec64.exe -i \\" & DeployMachine & " -u ntp\daniel_admin -p BarkHornSlam4* cmd.exe copy """ & _
  19. transferFolder & "zzip.zip"" " & """" & remoteDeployPath & "\zzip.zip""" & " & tar -xf ""C:\inetpub\tracking\zip.zip"" -C ""C:\inetpub\tracking"""
  20. WshShell.Run ScriptDirectory & "PsExec64.exe -i \\" & DeployMachine & " -u ntp\daniel_admin -p BarkHornSlam4* cmd.exe /C copy """ & _
  21. transferFolder & "\zzip.zip"" " & """" & remoteDeployPath & "\zip.zip""" & " & tar -xf ""C:\inetpub\tracking\zip.zip"" -C ""C:\inetpub\tracking""",1,True
  22. End Sub
  23. Sub Cleanup
  24. WshShell.CurrentDirectory = DeployRoot
  25. WshShell.Run "cmd.exe /c rmdir /s /q """ & DeployRoot & "test\""" , 0,True
  26. WScript.Sleep 2500
  27. WScript.Sleep 2500
  28. fso.DeleteFile DeployRoot & "\zzip.zip"
  29. End Sub
  30. Sub ZipRepo
  31. WScript.Sleep 2500
  32. WScript.Sleep 2500
  33. fso.OpenTextFile(DeployRoot & "zzip.zip", 2, True).Write "PK" & Chr(5) & Chr(6) _
  34. & String(18, Chr(0))
  35. WScript.Sleep 2500
  36. WScript.Sleep 2500
  37. Dim objZip
  38. Set objZip = objShell.NameSpace(DeployRoot & "zzip.zip")
  39. Dim objFolder:Set objFolder = objShell.NameSpace(DeployRoot & "test\")
  40. objZip.CopyHere objFolder.Items
  41. Do Until objZip.Items.Count = objFolder.Items.Count
  42. WScript.Sleep 200
  43. Loop
  44. fso.CopyFile DeployRoot & "zzip.zip", transferFolder & "zzip.zip", True
  45. Set objFolder = nothing
  46. End Sub
  47. Sub CloneRepo
  48. WshShell.Exec("git init test")
  49. WScript.Sleep 2500
  50. WshShell.CurrentDirectory = DeployRoot & "test"
  51. WshShell.Exec("git remote add -f origin https://dcovington:_3ggUSA6YELP@onefortheroadgit.sytes.net/dcovington/tracking_kits")
  52. WshShell.Exec("git config core.sparseCheckout true")
  53. Dim objFile
  54. Set objFile = fso.CreateTextFile(".git/info/sparse-checkout")
  55. objFile.WriteLine("App/")
  56. objFile.WriteLine("Data/arrow ne.jpg")
  57. objFile.WriteLine("Data/Label_Report.rep")
  58. objFile.WriteLine("Data/png-transparent-arrow-arrow-angle-triangle-black-thumbnail.jpg")
  59. objFile.WriteLine("dist/")
  60. objFile.WriteLine("MVC/")
  61. objFile.WriteLine("Dependancies/")
  62. objFile.WriteLine("index.asp")
  63. objFile.WriteLine("web.config")
  64. WshShell.Exec("git pull origin master")
  65. objFile.Close
  66. Do until fso.FileExists(DeployRoot & "test\App\app.config.asp")
  67. WScript.Sleep 250
  68. Loop
  69. Set objFile = fso.OpenTextFile(DeployRoot & "test\App\app.config.asp",1)
  70. Dim readConfigFile:readConfigFile = objFile.ReadAll
  71. objFile.Close
  72. Dim devToFalseSetting:devToFalseSetting = Replace(readConfigFile,"dev = true","dev = false")
  73. Set objFile = fso.OpenTextFile(DeployRoot & "test\App\app.config.asp",2)
  74. objFile.Write(devToFalseSetting)
  75. objFile.Close
  76. End Sub
  77. '"F:\Development\Tracking_Kits\CiCd\test\App\app.config.asp"
  78. 'C:\Windows\System32\inetsrv\appcmd.exe stop apppool /apppool.name:tracking
  79. 'C:\Windows\System32\inetsrv\appcmd.exe stop site /site.name:tracking
  80. 'C:\Windows\System32\inetsrv\appcmd.exe start apppool /apppool.name:tracking
  81. 'C:\Windows\System32\inetsrv\appcmd.exe start site /site.name:tracking
  82. 'nircmd.exe elevatecmd runassystem

Powered by TurnKey Linux.