@@ -5,19 +5,17 @@ Vagrant.configure("2") do |config|
55 config . vm . network "forwarded_port" , guest : 445 , host : 445
66 config . vm . provision "shell" , inline : "Set-NetFirewallProfile -Profile Domain,Public,Private -Enabled False"
77 config . vm . provider "libvirt" do |libvirt |
8- libvirt . memory = $MEMORY
9- libvirt . cpus = $CPU
10- libvirt . machine_virtual_size = $DISK_SIZE
8+ libvirt . memory = ${ MEMORY }
9+ libvirt . cpus = ${ CPU }
10+ libvirt . machine_virtual_size = ${ DISK_SIZE }
1111 end
1212 config . winrm . max_tries = 300 # default is 20
1313 config . winrm . retry_delay = 5 #seconds. This is the defaul value and just here for documentation.
1414 config . vm . provision "shell" , powershell_elevated_interactive : false , privileged : false , inline : <<-SHELL
1515 # Install Chocolatey - Also Grabs 7Zip
1616 Invoke-Expression "& { $(Invoke-RestMethod 'https://aka.ms/install-powershell.ps1') } -AddToPath"
1717 Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
18- choco install 7zip.install -y
19- choco install git.install -y
20- choco install jq -y
18+ choco install 7zip.install git.install jq -y
2119 # c:/ default location
2220 Set-Location /
2321 # Install build tools
@@ -26,19 +24,27 @@ Vagrant.configure("2") do |config|
2624 # Install rtools40
2725 Invoke-WebRequest -Uri "https://cran.r-project.org/bin/windows/Rtools/rtools40-x86_64.exe" -OutFile "rtools.exe"
2826 Start-Process "./rtools.exe" -Argument "/Silent" -PassThru -Wait
29- [Environment]::SetEnvironmentVariable("PATH", ${DOLLAR}Env :Path + ";C:\\ rtools40\\ usr\\ bin;C:\\ rtools40\\ mingw64\\ bin", [EnvironmentVariableTarget]::Machine)
30- ${DOLLAR} env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User")
27+ [Environment]::SetEnvironmentVariable("PATH", $env :Path + ";C:\\ rtools40\\ usr\\ bin;C:\\ rtools40\\ mingw64\\ bin", [EnvironmentVariableTarget]::Machine)
28+ $env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User")
3129 C:\\ rtools40\\ msys2.exe pacman -Sy --noconfirm mingw-w64-x86_64-make
3230 Remove-Item -Path ./rtools.exe
3331 # Resize disk
34- Resize-Partition -DriveLetter "C" -Size (Get-PartitionSupportedSize -DriveLetter "C").SizeMax
32+ Resize-Partition -DriveLetter "C" -Size (Get-PartitionSupportedSize -DriveLetter "C").SizeMax
33+ # Enable too long paths
34+ New-ItemProperty -Path "HKLM:\\ SYSTEM\\ CurrentControlSet\\ Control\\ FileSystem" -Name "LongPathsEnabled" -Value 1 -PropertyType DWORD -Force
3535 # github actions
36- mkdir actions-runner
37- Set-Location actions-runner
38- Invoke-WebRequest -Uri $GITHUB_RUNNER_URL -OutFile $GITHUB_RUNNER_FILE
39- Expand-Archive $GITHUB_RUNNER_FILE -DestinationPath .
40- ./config.cmd --name ${GITHUB_RUNNER_NAME}_${RANDOM_STR} --replace --unattended --url $ORGANIZATION_URL --labels $GITHUB_RUNNER_LABELS --pat $PAT
41- ./run.cmd
36+ Invoke-WebRequest -Uri ${GITHUB_RUNNER_URL} -OutFile ${GITHUB_RUNNER_FILE}
37+ Expand-Archive -LiteralPath ${GITHUB_RUNNER_FILE} -DestinationPath runner -Force;
38+ C:\\ runner\\ config.cmd --name ${GITHUB_RUNNER_NAME} --replace --unattended --url ${ORGANIZATION_URL} --labels ${GITHUB_RUNNER_LABELS} --pat ${PAT}
39+ C:\\ runner\\ run.cmd
40+ # Remove-Item -Path C:\\ runner-* -Recurse -Force
41+ # for ($runner = 1 ; $runner -le ${RUNNERS} ; $runner++){
42+ # Write-Host "Running $runner";
43+ # $random = -join ((48..57) + (97..122) | Get-Random -Count 8 | % {[char]$_});
44+ # Expand-Archive -LiteralPath ${GITHUB_RUNNER_FILE} -DestinationPath runner-$random -Force;
45+ # Invoke-Expression -Command "C:\\ runner-$random\\ config.cmd --name ${GITHUB_RUNNER_NAME}_$random --replace --unattended --url ${ORGANIZATION_URL} --labels ${GITHUB_RUNNER_LABELS} --pat ${PAT}";
46+ # Start-Process -NoNewWindow "C:\\ runner-$random\\ run.cmd";
47+ # }
4248 SHELL
4349end
4450
0 commit comments