Commit 4958d626 authored by xsyvITyt's avatar xsyvITyt

Minimum implementation of protected runner

parent 9d3538ff
Pipeline #57978740 passed with stages
in 33 minutes and 57 seconds
......@@ -15,7 +15,7 @@ import (
units ""
api ""
......@@ -275,6 +275,8 @@ type RunnerSettings struct {
PreCloneScript string `toml:"pre_clone_script,omitempty" json:"pre_clone_script" long:"pre-clone-script" env:"RUNNER_PRE_CLONE_SCRIPT" description:"Runner-specific command script executed before code is pulled"`
PreBuildScript string `toml:"pre_build_script,omitempty" json:"pre_build_script" long:"pre-build-script" env:"RUNNER_PRE_BUILD_SCRIPT" description:"Runner-specific command script executed after code is pulled, just before build executes"`
PostBuildScript string `toml:"post_build_script,omitempty" json:"post_build_script" long:"post-build-script" env:"RUNNER_POST_BUILD_SCRIPT" description:"Runner-specific command script executed after code is pulled and just after build executes"`
NoUserScripts bool `toml:"no_user_scripts,omitempty" json:"no_user_scripts" long:"no-user-scripts" env:"RUNNER_NO_USER_SCRIPTS" description:"Runner-specific option to disable use of user-defined scripts"`
Script []string `toml:"script" json:"script" long:"script" env:"RUNNER_SCRIPT" description:"Runner-specific script to use when user scripts are disabled"`
DebugTraceDisabled bool `toml:"debug_trace_disabled,omitempty" json:"debug_trace_disabled" long:"debug-trace-disabled" env:"RUNNER_DEBUG_TRACE_DISABLED" description:"When set to true Runner will disable the possibility of using the CI_DEBUG_TRACE feature"`
......@@ -533,6 +533,17 @@ func (b *AbstractShell) writeUserScript(w ShellWriter, info common.ShellScriptIn
if info.Build.Runner.NoUserScripts {
// TODO: validate that Runner.Script is valid
scriptStep = &common.Step{
Name: "runnerdefinedstep",
Script: info.Build.Runner.Script,
Timeout: 100,
When: common.StepWhenOnSuccess,
AllowFailure: false,
if scriptStep == nil {
return nil
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment