Unverified Commit a419fbe4 authored by Tomasz Maczukin's avatar Tomasz Maczukin Committed by Tomasz Maczukin

Merge branch 'make-docker-windows-to-work-only-on-windows' into 'master'

Limit `docker-windows` to Windows

Closes #4255

See merge request gitlab-org/gitlab-runner!1362
parent 045ca3c0
......@@ -49,6 +49,8 @@ Docker executor:
to start the container, see
[#3754](https://gitlab.com/gitlab-org/gitlab-runner/issues/3754) for
additional detail.
- `docker-windows` executor can be run only using GitLab Runner running
on Windows.
### Supported Windows versions
......@@ -73,7 +75,6 @@ When you register a new Runner in interactive mode,
you can't choose `docker-windows` as an executor and must instead
edit the `config.toml` that is created/updated.
In addition, an incorrect Windows path for the
[`volumes`](../configuration/advanced-configuration.md#the-runnersdocker-section)
key is defined in `config.toml` file. User must manually edit this key
......
......@@ -103,11 +103,6 @@ func (s *commandExecutor) Run(cmd common.ExecutorCommand) error {
}
func init() {
initializeLinuxDockerExecutor()
initializeWindowsDockerExecutor()
}
func initializeLinuxDockerExecutor() {
options := executors.ExecutorOptions{
DefaultCustomBuildsDirEnabled: true,
DefaultBuildsDir: "/builds",
......@@ -150,47 +145,3 @@ func initializeLinuxDockerExecutor() {
DefaultShellName: options.Shell.Shell,
})
}
func initializeWindowsDockerExecutor() {
options := executors.ExecutorOptions{
DefaultCustomBuildsDirEnabled: true,
DefaultBuildsDir: `c:\builds`,
DefaultCacheDir: `c:\cache`,
SharedBuildsDir: false,
Shell: common.ShellScriptInfo{
Shell: "powershell",
Type: common.NormalShell,
RunnerCommand: "gitlab-runner-helper",
},
ShowHostname: true,
Metadata: map[string]string{
"OSType": osTypeWindows,
},
}
creator := func() common.Executor {
e := &commandExecutor{
executor: executor{
AbstractExecutor: executors.AbstractExecutor{
ExecutorOptions: options,
},
},
}
e.SetCurrentStage(common.ExecutorStageCreated)
return e
}
featuresUpdater := func(features *common.FeaturesInfo) {
features.Variables = true
features.Image = true
features.Services = true
features.Session = false
features.Terminal = false
}
common.RegisterExecutor("docker-windows", executors.DefaultExecutorProvider{
Creator: creator,
FeaturesUpdater: featuresUpdater,
DefaultShellName: options.Shell.Shell,
})
}
package docker
import (
"gitlab.com/gitlab-org/gitlab-runner/common"
"gitlab.com/gitlab-org/gitlab-runner/executors"
)
func init() {
options := executors.ExecutorOptions{
DefaultCustomBuildsDirEnabled: true,
DefaultBuildsDir: `c:\builds`,
DefaultCacheDir: `c:\cache`,
SharedBuildsDir: false,
Shell: common.ShellScriptInfo{
Shell: "powershell",
Type: common.NormalShell,
RunnerCommand: "gitlab-runner-helper",
},
ShowHostname: true,
Metadata: map[string]string{
"OSType": osTypeWindows,
},
}
creator := func() common.Executor {
e := &commandExecutor{
executor: executor{
AbstractExecutor: executors.AbstractExecutor{
ExecutorOptions: options,
},
},
}
e.SetCurrentStage(common.ExecutorStageCreated)
return e
}
featuresUpdater := func(features *common.FeaturesInfo) {
features.Variables = true
features.Image = true
features.Services = true
features.Session = false
features.Terminal = false
}
common.RegisterExecutor("docker-windows", executors.DefaultExecutorProvider{
Creator: creator,
FeaturesUpdater: featuresUpdater,
DefaultShellName: options.Shell.Shell,
})
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment