Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions agent/agent_configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ type AgentConfiguration struct {
GitCleanFlags string
GitFetchFlags string
GitSubmodules bool
GitSubmoduleCloneConfig []string
SkipCheckout bool
GitSkipFetchExistingCommits bool
AllowedRepositories []*regexp.Regexp
Expand Down
2 changes: 2 additions & 0 deletions agent/job_runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,7 @@ BUILDKITE_GIT_MIRRORS_LOCK_TIMEOUT
BUILDKITE_GIT_MIRRORS_PATH
BUILDKITE_GIT_MIRRORS_SKIP_UPDATE
BUILDKITE_GIT_SUBMODULES
BUILDKITE_GIT_SUBMODULE_CLONE_CONFIG
BUILDKITE_CANCEL_GRACE_PERIOD
BUILDKITE_COMMAND_EVAL
BUILDKITE_LOCAL_HOOKS_ENABLED
Expand Down Expand Up @@ -586,6 +587,7 @@ BUILDKITE_AGENT_JWKS_KEY_ID`
setEnv("BUILDKITE_GIT_CLONE_MIRROR_FLAGS", r.conf.AgentConfiguration.GitCloneMirrorFlags)
setEnv("BUILDKITE_GIT_CLEAN_FLAGS", r.conf.AgentConfiguration.GitCleanFlags)
setEnv("BUILDKITE_GIT_MIRRORS_LOCK_TIMEOUT", strconv.Itoa(r.conf.AgentConfiguration.GitMirrorsLockTimeout))
setEnv("BUILDKITE_GIT_SUBMODULE_CLONE_CONFIG", strings.Join(r.conf.AgentConfiguration.GitSubmoduleCloneConfig, ","))

setEnv("BUILDKITE_SHELL", r.conf.AgentConfiguration.Shell)
setEnv("BUILDKITE_AGENT_EXPERIMENT", strings.Join(experiments.Enabled(ctx), ","))
Expand Down
30 changes: 19 additions & 11 deletions clicommand/agent_start.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,17 +150,18 @@ type AgentStartConfig struct {
WaitForECSMetaDataTimeout string `cli:"wait-for-ecs-meta-data-timeout"`
WaitForGCPLabelsTimeout string `cli:"wait-for-gcp-labels-timeout"`

GitCheckoutFlags string `cli:"git-checkout-flags"`
GitCloneFlags string `cli:"git-clone-flags"`
GitCloneMirrorFlags string `cli:"git-clone-mirror-flags"`
GitCleanFlags string `cli:"git-clean-flags"`
GitFetchFlags string `cli:"git-fetch-flags"`
GitMirrorsPath string `cli:"git-mirrors-path" normalize:"filepath"`
GitMirrorsLockTimeout int `cli:"git-mirrors-lock-timeout"`
GitMirrorsSkipUpdate bool `cli:"git-mirrors-skip-update"`
NoGitSubmodules bool `cli:"no-git-submodules"`
SkipCheckout bool `cli:"skip-checkout"`
GitSkipFetchExistingCommits bool `cli:"git-skip-fetch-existing-commits"`
GitCheckoutFlags string `cli:"git-checkout-flags"`
GitCloneFlags string `cli:"git-clone-flags"`
GitCloneMirrorFlags string `cli:"git-clone-mirror-flags"`
GitCleanFlags string `cli:"git-clean-flags"`
GitFetchFlags string `cli:"git-fetch-flags"`
GitMirrorsPath string `cli:"git-mirrors-path" normalize:"filepath"`
GitMirrorsLockTimeout int `cli:"git-mirrors-lock-timeout"`
GitMirrorsSkipUpdate bool `cli:"git-mirrors-skip-update"`
NoGitSubmodules bool `cli:"no-git-submodules"`
GitSubmoduleCloneConfig []string `cli:"git-submodule-clone-config"`
SkipCheckout bool `cli:"skip-checkout"`
GitSkipFetchExistingCommits bool `cli:"git-skip-fetch-existing-commits"`

NoSSHKeyscan bool `cli:"no-ssh-keyscan"`
NoCommandEval bool `cli:"no-command-eval"`
Expand Down Expand Up @@ -551,6 +552,12 @@ var AgentStartCommand = cli.Command{
Usage: "Skip updating the Git mirror (default: false)",
EnvVar: "BUILDKITE_GIT_MIRRORS_SKIP_UPDATE",
},
cli.StringSliceFlag{
Name: "git-submodule-clone-config",
Value: &cli.StringSlice{},
Usage: "Comma separated key=value git config pairs applied before git submodule clone commands such as ′update --init′. If the config is needed to be applied to all git commands, supply it in a global git config file for the system that the agent runs in instead",
EnvVar: "BUILDKITE_GIT_SUBMODULE_CLONE_CONFIG",
},
cli.StringFlag{
Name: "bootstrap-script",
Value: "",
Expand Down Expand Up @@ -1080,6 +1087,7 @@ var AgentStartCommand = cli.Command{
GitCleanFlags: cfg.GitCleanFlags,
GitFetchFlags: cfg.GitFetchFlags,
GitSubmodules: !cfg.NoGitSubmodules,
GitSubmoduleCloneConfig: cfg.GitSubmoduleCloneConfig,
SkipCheckout: cfg.SkipCheckout,
GitSkipFetchExistingCommits: cfg.GitSkipFetchExistingCommits,
SSHKeyscan: !cfg.NoSSHKeyscan,
Expand Down
2 changes: 1 addition & 1 deletion clicommand/bootstrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ type BootstrapConfig struct {
GitMirrorsPath string `cli:"git-mirrors-path" normalize:"filepath"`
GitMirrorsLockTimeout int `cli:"git-mirrors-lock-timeout"`
GitMirrorsSkipUpdate bool `cli:"git-mirrors-skip-update"`
GitSubmoduleCloneConfig []string `cli:"git-submodule-clone-config"`
GitSubmoduleCloneConfig []string `cli:"git-submodule-clone-config" normalize:"list"`
BinPath string `cli:"bin-path" normalize:"filepath"`
BuildPath string `cli:"build-path" normalize:"filepath"`
HooksPath string `cli:"hooks-path" normalize:"filepath"`
Expand Down