mirror of
https://git.vectorsigma.ru/public/atlantis.git
synced 2026-07-29 12:58:20 +00:00
feat: add autodiscover enabled feature (#3895)
* add flag to allow the user disable the autodiscover * add global config and doc * feat: Implement autodiscover.mode * fix: Minor doc fixes * fix: Small fixes to docs/indent/tests * fix: Line length, quoting, function comments * fix: Add a few more tests and remove newlines * fix: Always camel case never snake --------- Co-authored-by: Marcelo Medeiros <m.medeiros@carepay.com> Co-authored-by: nitrocode <7775707+nitrocode@users.noreply.github.com> Co-authored-by: PePe Amengual <jose.amengual@gmail.com>
This commit is contained in:
@@ -54,6 +54,7 @@ const (
|
||||
AllowForkPRsFlag = "allow-fork-prs"
|
||||
AllowRepoConfigFlag = "allow-repo-config"
|
||||
AtlantisURLFlag = "atlantis-url"
|
||||
AutoDiscoverModeFlag = "autodiscover-mode"
|
||||
AutomergeFlag = "automerge"
|
||||
ParallelPlanFlag = "parallel-plan"
|
||||
ParallelApplyFlag = "parallel-apply"
|
||||
@@ -148,6 +149,7 @@ const (
|
||||
DefaultADBasicUser = ""
|
||||
DefaultADBasicPassword = ""
|
||||
DefaultADHostname = "dev.azure.com"
|
||||
DefaultAutoDiscoverMode = "auto"
|
||||
DefaultAutoplanFileList = "**/*.tf,**/*.tfvars,**/*.tfvars.json,**/terragrunt.hcl,**/.terraform.lock.hcl"
|
||||
DefaultAllowCommands = "version,plan,apply,unlock,approve_policies"
|
||||
DefaultCheckoutStrategy = CheckoutStrategyBranch
|
||||
@@ -207,6 +209,12 @@ var stringFlags = map[string]stringFlag{
|
||||
AtlantisURLFlag: {
|
||||
description: "URL that Atlantis can be reached at. Defaults to http://$(hostname):$port where $port is from --" + PortFlag + ". Supports a base path ex. https://example.com/basepath.",
|
||||
},
|
||||
AutoDiscoverModeFlag: {
|
||||
description: "Auto discover mode controls whether projects in a repo are discovered by Atlantis. Defaults to 'auto' which " +
|
||||
"means projects will be discovered when no explicit projects are defined in repo config. Also supports 'enabled' (always " +
|
||||
"discover projects) and 'disabled' (never discover projects).",
|
||||
defaultValue: DefaultAutoDiscoverMode,
|
||||
},
|
||||
AutoplanModulesFromProjects: {
|
||||
description: "Comma separated list of file patterns to select projects Atlantis will index for module dependencies." +
|
||||
" Indexed projects will automatically be planned if a module they depend on is modified." +
|
||||
@@ -871,6 +879,9 @@ func (s *ServerCmd) setDefaults(c *server.UserConfig) {
|
||||
if c.WebPassword == "" {
|
||||
c.WebPassword = DefaultWebPassword
|
||||
}
|
||||
if c.AutoDiscoverModeFlag == "" {
|
||||
c.AutoDiscoverModeFlag = DefaultAutoDiscoverMode
|
||||
}
|
||||
}
|
||||
|
||||
func (s *ServerCmd) validate(userConfig server.UserConfig) error {
|
||||
|
||||
@@ -60,6 +60,7 @@ var testFlags = map[string]interface{}{
|
||||
AllowCommandsFlag: "version,plan,unlock,import,approve_policies", // apply is disabled by DisableApply
|
||||
AllowForkPRsFlag: true,
|
||||
AllowRepoConfigFlag: true,
|
||||
AutoDiscoverModeFlag: "auto",
|
||||
AutomergeFlag: true,
|
||||
AutoplanFileListFlag: "**/*.tf,**/*.yml",
|
||||
BitbucketBaseURLFlag: "https://bitbucket-base-url.com",
|
||||
|
||||
Reference in New Issue
Block a user