github.com/secure-build/gitlab-runner@v12.5.0+incompatible/executors/docker/executor_docker_command_windows.go (about)

     1  package docker
     2  
     3  import (
     4  	"gitlab.com/gitlab-org/gitlab-runner/common"
     5  	"gitlab.com/gitlab-org/gitlab-runner/executors"
     6  	"gitlab.com/gitlab-org/gitlab-runner/executors/docker/internal/volumes/parser"
     7  )
     8  
     9  func init() {
    10  	options := executors.ExecutorOptions{
    11  		DefaultCustomBuildsDirEnabled: true,
    12  		DefaultBuildsDir:              `c:\builds`,
    13  		DefaultCacheDir:               `c:\cache`,
    14  		SharedBuildsDir:               false,
    15  		Shell: common.ShellScriptInfo{
    16  			Shell:         "powershell",
    17  			Type:          common.NormalShell,
    18  			RunnerCommand: "gitlab-runner-helper",
    19  		},
    20  		ShowHostname: true,
    21  		Metadata: map[string]string{
    22  			metadataOSType: osTypeWindows,
    23  		},
    24  	}
    25  
    26  	creator := func() common.Executor {
    27  		e := &commandExecutor{
    28  			executor: executor{
    29  				AbstractExecutor: executors.AbstractExecutor{
    30  					ExecutorOptions: options,
    31  				},
    32  				volumeParser: parser.NewWindowsParser(),
    33  			},
    34  		}
    35  		e.SetCurrentStage(common.ExecutorStageCreated)
    36  		return e
    37  	}
    38  
    39  	featuresUpdater := func(features *common.FeaturesInfo) {
    40  		features.Variables = true
    41  		features.Image = true
    42  		features.Services = true
    43  		features.Session = false
    44  		features.Terminal = false
    45  	}
    46  
    47  	common.RegisterExecutor("docker-windows", executors.DefaultExecutorProvider{
    48  		Creator:          creator,
    49  		FeaturesUpdater:  featuresUpdater,
    50  		DefaultShellName: options.Shell.Shell,
    51  	})
    52  }