Merge branch 'master' into ja3
This commit is contained in:
@@ -1,10 +1,10 @@
|
|||||||
if not exist "C:\Windows\Temp\7z1900-x64.msi" (
|
if not exist "C:\Windows\Temp\7z1900-x64.msi" (
|
||||||
powershell -Command "(New-Object System.Net.WebClient).DownloadFile('https://www.7-zip.org/a/7z1900-x64.msi', 'C:\Windows\Temp\7z1900-x64.msi')" <NUL
|
powershell -Command "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; (New-Object System.Net.WebClient).DownloadFile('https://www.7-zip.org/a/7z1900-x64.msi', 'C:\Windows\Temp\7z1900-x64.msi')" <NUL
|
||||||
)
|
)
|
||||||
msiexec /qb /i C:\Windows\Temp\7z1900-x64.msi
|
msiexec /qb /i C:\Windows\Temp\7z1900-x64.msi
|
||||||
|
|
||||||
if not exist "C:\Windows\Temp\ultradefrag.zip" (
|
if not exist "C:\Windows\Temp\ultradefrag.zip" (
|
||||||
powershell -Command "(New-Object System.Net.WebClient).DownloadFile('https://downloads.sourceforge.net/project/ultradefrag/stable-release/6.1.0/ultradefrag-portable-6.1.0.bin.amd64.zip', 'C:\Windows\Temp\ultradefrag.zip')" <NUL
|
powershell -Command "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; (New-Object System.Net.WebClient).DownloadFile('https://downloads.sourceforge.net/project/ultradefrag/stable-release/6.1.0/ultradefrag-portable-6.1.0.bin.amd64.zip', 'C:\Windows\Temp\ultradefrag.zip')" <NUL
|
||||||
)
|
)
|
||||||
|
|
||||||
if not exist "C:\Windows\Temp\ultradefrag-portable-6.1.0.amd64\udefrag.exe" (
|
if not exist "C:\Windows\Temp\ultradefrag-portable-6.1.0.amd64\udefrag.exe" (
|
||||||
@@ -12,8 +12,8 @@ if not exist "C:\Windows\Temp\ultradefrag-portable-6.1.0.amd64\udefrag.exe" (
|
|||||||
)
|
)
|
||||||
|
|
||||||
if not exist "C:\Windows\Temp\SDelete.zip" (
|
if not exist "C:\Windows\Temp\SDelete.zip" (
|
||||||
powershell -Command "(New-Object System.Net.WebClient).DownloadFile('https://download.sysinternals.com/files/SDelete.zip', 'C:\Windows\Temp\SDelete.zip')" <NUL
|
powershell -Command "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; (New-Object System.Net.WebClient).DownloadFile('https://download.sysinternals.com/files/SDelete.zip', 'C:\Windows\Temp\SDelete.zip')" <NUL
|
||||||
powershell -Command "(New-Object System.Net.WebClient).DownloadFile('https://vagrantboxes.blob.core.windows.net/box/sdelete/v1.6.1/sdelete.exe', 'C:\Windows\Temp\sdelete.exe')" <NUL
|
powershell -Command "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; (New-Object System.Net.WebClient).DownloadFile('https://vagrantboxes.blob.core.windows.net/box/sdelete/v1.6.1/sdelete.exe', 'C:\Windows\Temp\sdelete.exe')" <NUL
|
||||||
)
|
)
|
||||||
|
|
||||||
if not exist "C:\Windows\Temp\sdelete.exe" (
|
if not exist "C:\Windows\Temp\sdelete.exe" (
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
if not exist "C:\Windows\Temp\7z1900-x64.msi" (
|
if not exist "C:\Windows\Temp\7z1900-x64.msi" (
|
||||||
powershell -Command "(New-Object System.Net.WebClient).DownloadFile('https://www.7-zip.org/a/7z1900-x64.msi', 'C:\Windows\Temp\7z1900-x64.msi')" <NUL
|
powershell -Command "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; (New-Object System.Net.WebClient).DownloadFile('https://www.7-zip.org/a/7z1900-x64.msi', 'C:\Windows\Temp\7z1900-x64.msi')" <NUL
|
||||||
)
|
)
|
||||||
if not exist "C:\Windows\Temp\7z1900-x64.msi" (
|
if not exist "C:\Windows\Temp\7z1900-x64.msi" (
|
||||||
powershell -Command "Start-Sleep 5 ; (New-Object System.Net.WebClient).DownloadFile('https://www.7-zip.org/a/7z1900-x64.msi', 'C:\Windows\Temp\7z1900-x64.msi')" <NUL
|
powershell -Command "Start-Sleep 5; [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; (New-Object System.Net.WebClient).DownloadFile('https://www.7-zip.org/a/7z1900-x64.msi', 'C:\Windows\Temp\7z1900-x64.msi')" <NUL
|
||||||
)
|
)
|
||||||
msiexec /qb /i C:\Windows\Temp\7z1900-x64.msi
|
msiexec /qb /i C:\Windows\Temp\7z1900-x64.msi
|
||||||
|
|
||||||
@@ -17,7 +17,7 @@ if exist "C:\Users\vagrant\windows.iso" (
|
|||||||
)
|
)
|
||||||
|
|
||||||
if not exist "C:\Windows\Temp\windows.iso" (
|
if not exist "C:\Windows\Temp\windows.iso" (
|
||||||
powershell -Command "(New-Object System.Net.WebClient).DownloadFile('https://softwareupdate.vmware.com/cds/vmw-desktop/ws/15.0.4/12990004/windows/packages/tools-windows.tar', 'C:\Windows\Temp\vmware-tools.tar')" <NUL
|
powershell -Command "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; (New-Object System.Net.WebClient).DownloadFile('https://softwareupdate.vmware.com/cds/vmw-desktop/ws/15.0.4/12990004/windows/packages/tools-windows.tar', 'C:\Windows\Temp\vmware-tools.tar')" <NUL
|
||||||
cmd /c ""C:\Program Files\7-Zip\7z.exe" x C:\Windows\Temp\vmware-tools.tar -oC:\Windows\Temp"
|
cmd /c ""C:\Program Files\7-Zip\7z.exe" x C:\Windows\Temp\vmware-tools.tar -oC:\Windows\Temp"
|
||||||
FOR /r "C:\Windows\Temp" %%a in (VMware-tools-windows-*.iso) DO REN "%%~a" "windows.iso"
|
FOR /r "C:\Windows\Temp" %%a in (VMware-tools-windows-*.iso) DO REN "%%~a" "windows.iso"
|
||||||
rd /S /Q "C:\Program Files (x86)\VMWare"
|
rd /S /Q "C:\Program Files (x86)\VMWare"
|
||||||
@@ -38,7 +38,7 @@ if exist "C:\Users\vagrant\VBoxGuestAdditions.iso" (
|
|||||||
)
|
)
|
||||||
|
|
||||||
if not exist "C:\Windows\Temp\VBoxGuestAdditions.iso" (
|
if not exist "C:\Windows\Temp\VBoxGuestAdditions.iso" (
|
||||||
powershell -Command "(New-Object System.Net.WebClient).DownloadFile('https://download.virtualbox.org/virtualbox/5.2.26/VBoxGuestAdditions_5.2.26.iso', 'C:\Windows\Temp\VBoxGuestAdditions.iso')" <NUL
|
powershell -Command "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; (New-Object System.Net.WebClient).DownloadFile('https://download.virtualbox.org/virtualbox/5.2.26/VBoxGuestAdditions_5.2.26.iso', 'C:\Windows\Temp\VBoxGuestAdditions.iso')" <NUL
|
||||||
)
|
)
|
||||||
|
|
||||||
cmd /c ""C:\Program Files\7-Zip\7z.exe" x C:\Windows\Temp\VBoxGuestAdditions.iso -oC:\Windows\Temp\virtualbox"
|
cmd /c ""C:\Program Files\7-Zip\7z.exe" x C:\Windows\Temp\VBoxGuestAdditions.iso -oC:\Windows\Temp\virtualbox"
|
||||||
|
|||||||
12
build.ps1
12
build.ps1
@@ -25,6 +25,9 @@
|
|||||||
.PARAMETER PackerPath
|
.PARAMETER PackerPath
|
||||||
The full path to the packer executable. Default is C:\Hashicorp\packer.exe
|
The full path to the packer executable. Default is C:\Hashicorp\packer.exe
|
||||||
|
|
||||||
|
.PARAMETER PackerOnly
|
||||||
|
This switch skips deploying boxes with vagrant after being built by packer
|
||||||
|
|
||||||
.PARAMETER VagrantOnly
|
.PARAMETER VagrantOnly
|
||||||
This switch skips building packer boxes and instead downloads from Vagrant Cloud
|
This switch skips building packer boxes and instead downloads from Vagrant Cloud
|
||||||
|
|
||||||
@@ -48,6 +51,7 @@ Param(
|
|||||||
[ValidateSet('virtualbox', 'vmware_desktop')]
|
[ValidateSet('virtualbox', 'vmware_desktop')]
|
||||||
[string]$ProviderName,
|
[string]$ProviderName,
|
||||||
[string]$PackerPath = 'C:\Hashicorp\packer.exe',
|
[string]$PackerPath = 'C:\Hashicorp\packer.exe',
|
||||||
|
[switch]$PackerOnly,
|
||||||
[switch]$VagrantOnly
|
[switch]$VagrantOnly
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -186,6 +190,7 @@ function preflight_checks {
|
|||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!($PackerOnly)) {
|
||||||
Write-Host '[preflight_checks] Checking if Vagrant is installed'
|
Write-Host '[preflight_checks] Checking if Vagrant is installed'
|
||||||
check_vagrant
|
check_vagrant
|
||||||
|
|
||||||
@@ -233,6 +238,7 @@ function preflight_checks {
|
|||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
Write-Host '[preflight_checks] Finished.'
|
Write-Host '[preflight_checks] Finished.'
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -262,11 +268,11 @@ function move_boxes {
|
|||||||
Write-Host "[move_boxes] Running.."
|
Write-Host "[move_boxes] Running.."
|
||||||
Move-Item -Path $DL_DIR\Packer\*.box -Destination $DL_DIR\Boxes
|
Move-Item -Path $DL_DIR\Packer\*.box -Destination $DL_DIR\Boxes
|
||||||
if (-Not (Test-Path "$DL_DIR\Boxes\windows_10_$PackerProvider.box")) {
|
if (-Not (Test-Path "$DL_DIR\Boxes\windows_10_$PackerProvider.box")) {
|
||||||
Write-Error "Windows 10 box is missing from the Boxes directory. Qutting."
|
Write-Error "Windows 10 box is missing from the Boxes directory. Quitting."
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
if (-Not (Test-Path "$DL_DIR\Boxes\windows_2016_$PackerProvider.box")) {
|
if (-Not (Test-Path "$DL_DIR\Boxes\windows_2016_$PackerProvider.box")) {
|
||||||
Write-Error "Windows 2016 box is missing from the Boxes directory. Qutting."
|
Write-Error "Windows 2016 box is missing from the Boxes directory. Quitting."
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
Write-Host "[move_boxes] Finished."
|
Write-Host "[move_boxes] Finished."
|
||||||
@@ -387,6 +393,7 @@ if (!($VagrantOnly)) {
|
|||||||
move_boxes
|
move_boxes
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!($PackerOnly)) {
|
||||||
# Vagrant up each box and attempt to reload one time if it fails
|
# Vagrant up each box and attempt to reload one time if it fails
|
||||||
forEach ($VAGRANT_HOST in $LAB_HOSTS) {
|
forEach ($VAGRANT_HOST in $LAB_HOSTS) {
|
||||||
Write-Host "[main] Running vagrant_up_host for: $VAGRANT_HOST"
|
Write-Host "[main] Running vagrant_up_host for: $VAGRANT_HOST"
|
||||||
@@ -411,3 +418,4 @@ forEach ($VAGRANT_HOST in $LAB_HOSTS) {
|
|||||||
Write-Host "[main] Running post_build_checks"
|
Write-Host "[main] Running post_build_checks"
|
||||||
post_build_checks
|
post_build_checks
|
||||||
Write-Host "[main] Finished post_build_checks"
|
Write-Host "[main] Finished post_build_checks"
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user