Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
gitlab-runner
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Lars Seipel
gitlab-runner
Commits
1fc69d89
Unverified
Commit
1fc69d89
authored
6 years ago
by
Alessio Caiazza
Browse files
Options
Downloads
Patches
Plain Diff
Add vagrant config for testing on Windows
parent
17290488
Branches
Branches containing commit
No related tags found
Loading
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.gitignore
+2
-0
2 additions, 0 deletions
.gitignore
Vagrantfile
+20
-0
20 additions, 0 deletions
Vagrantfile
ci/vagrant.ps1
+111
-0
111 additions, 0 deletions
ci/vagrant.ps1
with
133 additions
and
0 deletions
.gitignore
+
2
−
0
View file @
1fc69d89
...
@@ -21,6 +21,8 @@ testsdefinitions.txt
...
@@ -21,6 +21,8 @@ testsdefinitions.txt
/.testoutput/
/.testoutput/
/.cover/
/.cover/
/.vagrant/
codeclimate.json
codeclimate.json
# Ignore the generated binary
# Ignore the generated binary
...
...
This diff is collapsed.
Click to expand it.
Vagrantfile
0 → 100644
+
20
−
0
View file @
1fc69d89
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant
.
configure
(
'2'
)
do
|
config
|
config
.
vm
.
define
'win10'
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:
'ci/vagrant.ps1'
end
config
.
vm
.
provider
'virtualbox'
do
|
vb
|
vb
.
gui
=
false
vb
.
memory
=
'2048'
vb
.
cpus
=
1
vb
.
linked_clone
=
true
end
end
This diff is collapsed.
Click to expand it.
ci/vagrant.ps1
0 → 100644
+
111
−
0
View file @
1fc69d89
$goVersion
=
"1.8"
$gitVersion
=
"2.18.0"
$srcFolder
=
"C:\Go\src\gitlab.com\gitlab-org\gitlab-runner"
function
Main
{
[
environment
]::
SetEnvironmentVariable
(
"RUNNER_SRC"
,
$srcFolder
,
"Machine"
)
Install-Go
(
$goVersion
)
Install-Git
(
$gitVersion
)
Install-SSH
}
function
Install-Go
([
string
]
$version
)
{
$file
=
'go'
+
$version
+
'.windows-amd64.msi'
$url
=
'https://storage.googleapis.com/golang/'
+
$file
$dest
=
Download
-Url
$url
Write-Host
"installing go
$version
..."
$logFile
=
Log-File
-App
'go'
$MSIArguments
=
@(
"/i"
(
'"{0}"'
-f
$dest
)
"/qn"
"/norestart"
"/L*v"
$logFile
)
Start-Process
"msiexec.exe"
-ArgumentList
$MSIArguments
-Wait
-NoNewWindow
Write-Host
"done"
Remove-Item
$dest
}
function
Install-Git
([
string
]
$version
)
{
$releaseVersion
=
'v'
+
$version
+
'.windows.1'
$file
=
'Git-'
+
$version
+
'-64-bit.exe'
$url
=
GitHubRelease
-Project
'git-for-windows/git'
-Version
$releaseVersion
-File
$file
$dest
=
Download
-Url
$url
Write-Host
"installing git
$version
..."
$logFile
=
Log-File
-App
'git'
$InstallArguments
=
@(
"/VERYSILENT"
(
'/LOG="{0}"'
-f
$logFile
)
)
Start-Process
$dest
-ArgumentList
$InstallArguments
-Wait
-NoNewWindow
Write-Host
"done"
Remove-Item
$dest
}
function
Install-SSH
{
Write-Host
"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
$cap
=
Get-WindowsCapability
-Online
|
?
Name
-like
"OpenSSH.Server*"
if
((
$cap
.
count
-ne
0
)
-and
(
$cap
[
0
]
.
State
-ne
"Installed"
))
{
Write-Host
"Install OpenSSH Server"
# Install the OpenSSH Server
Add-WindowsCapability
-Online
-Name
OpenSSH.Server~~~~0.0.1.0
# Install the OpenSSHUtils helper module, which is needed to fix the ACL for ths host keys.
# Install-Module -Force OpenSSHUtils
Write-Host
"Enable OpenSSH Server"
Start-Service
sshd
Write-Host
"Open OpenSSH Server port on firewall"
# Open firewall port
New-NetFirewallRule
-Protocol
TCP
-LocalPort
22
-Direction
Inbound
-Action
Allow
-DisplayName
SSH
}
}
function
GitHubRelease
([
string
]
$Project
,
[
string
]
$Version
=
'latest'
,
[
string
]
$File
)
{
'https://github.com/'
+
$Project
+
'/releases/download/'
+
$Version
+
'/'
+
$File
}
function
Download
([
string
]
$Url
)
{
$dest
=
[
System.IO.Path
]::
GetTempFileName
()
[
Net.ServicePointManager
]::
SecurityProtocol
=
"tls12, tls11"
Write-Host
"downloading
$Url
"
# Create client, set its info, and download
$wc
=
New-Object
System.Net.WebClient
$wc
.
UseDefaultCredentials
=
$true
$wc
.
Headers
.
Add
(
"X-FORMS_BASED_AUTH_ACCEPTED"
,
"f"
)
$wc
.
DownloadFile
(
$Url
,
$dest
)
Write-Host
"
$url
downloaded as
$dest
"
$dest
}
function
Log-File
(
$App
)
{
$timestamp
=
get-date
-Format
yyyyMMddTHHmmss
$logFile
=
'{0}-{1}.log'
-f
$App
,
$timestamp
$vagrantFolder
=
Join-Path
-Path
$srcFolder
-ChildPath
".vagrant"
Join-Path
-Path
$vagrantFolder
-ChildPath
$logFile
}
Main
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment