@@ -22,9 +22,9 @@ Vagrant.configure("2") do |config|
22
22
config . vm . network :forwarded_port , guest : 3389 , host : 14389 , id : 'rdp' , auto_correct : true
23
23
24
24
config . vm . provider "virtualbox" do |vb |
25
- vb . gui = true
26
- vb . memory = 4096
27
- vb . cpus = 2
25
+ vb . gui = ENV [ 'VM_GUI' ] ? ENV [ 'VM_GUI' ] . to_s . downcase == 'true' : true
26
+ vb . memory = ENV [ 'VM_MEMORY' ] ? ENV [ 'VM_MEMORY' ] . to_i : 4096
27
+ vb . cpus = ENV [ 'VM_CPU' ] ? ENV [ 'VM_CPU' ] . to_i : 2
28
28
vb . linked_clone = true
29
29
vb . customize [ 'modifyvm' , :id , '--vram' , '128' ]
30
30
end
@@ -37,32 +37,39 @@ Vagrant.configure("2") do |config|
37
37
38
38
config . vm . synced_folder '../' , '/chocoRoot'
39
39
40
- config . vm . provision "shell" , inline : <<-SHELL
40
+ config . vm . provision "shell" , name : "prep" , inline : <<-SHELL
41
41
cscript c:/windows/system32/slmgr.vbs /rearm | Out-Null
42
42
Set-ExecutionPolicy Bypass -Scope Process -Force
43
- [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072
44
- iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
43
+ iex (irm https://community.chocolatey.org/install.ps1)
45
44
46
- Write-Host "We are going to install some prerequisites now. This could take some time"
45
+ Write-Host "($(Get-Date -Format "dddd MM/dd/yyyy HH:mm:ss K")) We are going to install some prerequisites now. This could take some time"
47
46
$null = choco install git pester visualstudio2022community visualstudio2022-workload-manageddesktop netfx-4.8-devpack -y
48
47
Import-Module $env:ChocolateyInstall/helpers/chocolateyProfile.psm1
49
48
Update-SessionEnvironment
50
- Write-Host "Done installing software, now copying files"
49
+ Write-Host "($(Get-Date -Format "dddd MM/dd/yyyy HH:mm:ss K")) Done installing software, now copying files"
51
50
# If you try to build on macOS, then run this, there are attributes on some files that cause the build to fail inside of the vagrant environment.
52
- $null = robocopy c:/chocoRoot c:/code/choco /mir /copy:dt
51
+ $null = robocopy c:/chocoRoot c:/code/choco /e /copy:dt
52
+ SHELL
53
+ config . vm . provision "shell" , name : "build" , inline : <<-SHELL
54
+ $null = robocopy c:/chocoRoot c:/code/choco /e /copy:dt /purge
53
55
Push-Location c:/code/choco
54
- Write-Host "Files have been copied, beginning build process."
56
+ Write-Host "($(Get-Date -Format "dddd MM/dd/yyyy HH:mm:ss K")) Files have been copied, beginning build process."
55
57
$CakeOutput = ./build.bat 2>&1
58
+
56
59
if ($LastExitCode -ne 0) {
57
- Set-Content c:/vagrant/buildOutput.log -Value $CakeOutput
58
- Write-Host "The build has failed. Please see the buildOutput.log file for details"
59
- exit $LastExitCode
60
+ Set-Content c:/vagrant/buildOutput.log -Value $CakeOutput
61
+ Write-Host "The build has failed. Please see the buildOutput.log file for details"
62
+ exit $LastExitCode
60
63
}
61
64
62
- Write-Host "Build complete. Executing tests."
65
+ Write-Host "($(Get-Date -Format "dddd MM/dd/yyyy HH:mm:ss K")) Build complete."
66
+ SHELL
67
+ config . vm . provision "shell" , name : "test" , inline : <<-SHELL
68
+ Write-Host "($(Get-Date -Format "dddd MM/dd/yyyy HH:mm:ss K")) Starting Test Execution"
69
+ Push-Location c:/code/choco
63
70
# $env:TEST_KITCHEN = 1
64
71
$env:VM_RUNNING = 1
65
- ./Invoke-Tests.ps1
72
+ ./Invoke-Tests.ps1 -SkipPackaging
66
73
Copy-Item $env:ALLUSERSPROFILE/chocolatey/logs/testInvocations.log C:/vagrant
67
74
SHELL
68
75
end
0 commit comments