Skip to content
Snippets Groups Projects
Unverified Commit 2846edcb authored by Steve Azzopardi's avatar Steve Azzopardi
Browse files

Add windows 10 machine with vagrant

It is still useful to have windows 10 for development when you don't
need docker. The GUI is particularly useful, and this would help us test
on multiple windows machines as well.
parent 00bef043
No related branches found
No related tags found
No related merge requests found
...@@ -10,13 +10,14 @@ unless Vagrant.has_plugin?('vagrant-reload') ...@@ -10,13 +10,14 @@ unless Vagrant.has_plugin?('vagrant-reload')
end end
Vagrant.configure('2') do |config| Vagrant.configure('2') do |config|
config.vm.define 'win10' do |cfg| config.vm.define 'windows_server', primary: true do |cfg|
cfg.vm.box = 'StefanScherer/windows_2019_docker' cfg.vm.box = 'StefanScherer/windows_2019_docker'
cfg.vm.communicator = 'winrm' cfg.vm.communicator = 'winrm'
cfg.vm.synced_folder '.', 'C:\Go\src\gitlab.com\gitlab-org\gitlab-runner' cfg.vm.synced_folder '.', 'C:\Go\src\gitlab.com\gitlab-org\gitlab-runner'
cfg.vm.provision 'shell', path: 'scripts/vagrant/provision/base.ps1' cfg.vm.provision 'shell', path: 'scripts/vagrant/provision/base.ps1'
cfg.vm.provision 'shell', path: 'scripts/vagrant/provision/install_PSWindowsUpdate.ps1'
cfg.vm.provision 'shell', path: 'scripts/vagrant/provision/windows_update.ps1' cfg.vm.provision 'shell', path: 'scripts/vagrant/provision/windows_update.ps1'
# Restart the box to install the updates, and update again. # Restart the box to install the updates, and update again.
...@@ -27,6 +28,17 @@ Vagrant.configure('2') do |config| ...@@ -27,6 +28,17 @@ Vagrant.configure('2') do |config|
cfg.vm.provision 'shell', path: 'scripts/vagrant/provision/enable_sshd.ps1' cfg.vm.provision 'shell', path: 'scripts/vagrant/provision/enable_sshd.ps1'
end end
config.vm.define 'windows_10', autostart: false do |cfg|
cfg.vm.box = 'StefanScherer/windows_10'
cfg.vm.communicator = 'winrm'
cfg.vm.synced_folder '.', 'C:\Go\src\gitlab.com\gitlab-org\gitlab-runner'
cfg.vm.provision 'shell', path: 'scripts/vagrant/provision/base.ps1'
cfg.vm.provision 'shell', path: 'scripts/vagrant/provision/enable_developer_mode.ps1'
cfg.vm.provision 'shell', path: 'scripts/vagrant/provision/enable_sshd.ps1'
end
config.vm.provider 'virtualbox' do |vb| config.vm.provider 'virtualbox' do |vb|
vb.gui = false vb.gui = false
vb.memory = '2048' vb.memory = '2048'
......
...@@ -7,7 +7,6 @@ function Main ...@@ -7,7 +7,6 @@ function Main
[environment]::SetEnvironmentVariable("RUNNER_SRC", $srcFolder, "Machine") [environment]::SetEnvironmentVariable("RUNNER_SRC", $srcFolder, "Machine")
Install-Go($goVersion) Install-Go($goVersion)
Install-Git($gitVersion) Install-Git($gitVersion)
Install-PSWindowsUpdate
} }
function Install-Go([string]$version) function Install-Go([string]$version)
...@@ -52,19 +51,6 @@ function Install-Git([string]$version) ...@@ -52,19 +51,6 @@ function Install-Git([string]$version)
Remove-Item $dest Remove-Item $dest
} }
# Install https://www.powershellgallery.com/packages/PSWindowsUpdate so tha we
# can manually download windows update.
function Install-PSWindowsUpdate
{
Write-Output "Installing PSWindowsUpdate module"
# Make sure we can download from the Powershell Gallery https://www.powershellgallery.com/
Install-PackageProvider -Name NuGet -Force
Set-PSRepository -Name PSGallery -InstallationPolicy Trusted
# Install the actual module.
Install-Module -Name PSWindowsUpdate -Force
}
function GitHubRelease([string]$Project, [string]$Version = 'latest', [string]$File) { function GitHubRelease([string]$Project, [string]$Version = 'latest', [string]$File) {
'https://github.com/' + $Project + '/releases/download/' + $Version + '/' + $File 'https://github.com/' + $Project + '/releases/download/' + $Version + '/' + $File
} }
......
Write-Output "Enable Developer Mode"
# Create AppModelUnlock if it doesn't exist, required for enabling Developer Mode
$RegistryKeyPath = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock"
if (-not(Test-Path -Path $RegistryKeyPath)) {
New-Item -Path $RegistryKeyPath -ItemType Directory -Force
}
# Add registry value to enable Developer Mode
New-ItemProperty -Path $RegistryKeyPath -Name AllowDevelopmentWithoutDevLicense -PropertyType DWORD -Value 1
# Install https://www.powershellgallery.com/packages/PSWindowsUpdate so tha we
# can manually download windows update.
Write-Output "Installing PSWindowsUpdate module"
# Make sure we can download from the Powershell Gallery https://www.powershellgallery.com/
Install-PackageProvider -Name NuGet -Force
Set-PSRepository -Name PSGallery -InstallationPolicy Trusted
# Install the actual module.
Install-Module -Name PSWindowsUpdate -Force
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment