diff --git a/bitops.config.yaml b/bitops.config.yaml index 8f0b8451..17e4838c 100644 --- a/bitops.config.yaml +++ b/bitops.config.yaml @@ -13,7 +13,7 @@ bitops: filename: bitops-run # log filename err: bitops.logs # error logs filename path: /var/logs/bitops # path to log folder - opsrepo_root_default_dir: _default + default_folder: _default # https://bitovi.github.io/bitops/plugins/#bitopsconfigyaml plugins: {} diff --git a/docs/migration/2.0.0-migration.md b/docs/migration/2.0.0-migration.md index 395c629e..0371e640 100644 --- a/docs/migration/2.0.0-migration.md +++ b/docs/migration/2.0.0-migration.md @@ -1,6 +1,7 @@ # Bitops Core ## Environment Variables +### ENVIRONMENT Bitops is no longer using the `ENVIRONMENT` value, it instead uses; `BITOPS_ENVIRONMENT` Easiest migration solution; @@ -12,6 +13,9 @@ docker run \ bitovi/bitops:latest ``` +### DEFAULT_FOLDER +You can now control the default folder name with the environment variable `BITOPS_DEFAULT_FOLDER` + ### New Prefixes BitOps core exported environment variables now have a prefix of `BITOPS_` @@ -21,6 +25,7 @@ BitOps core exported environment variables now have a prefix of `BITOPS_` # Tool-level BitOps configs (i.e. bitops.config.yaml) in Operations Repo environments +## stack-action ops_repo level bitops.config.yaml have had one important update; The cli attribute "stack-action" has been added. This attribute is used to tell the BitOps plugin which method it is invoking. For example, the terraform plugin, has 3 stack-actions; @@ -44,9 +49,20 @@ terraform: ``` **Reasoning for the change** - This pattern is used by BitOps to standardize how a plugin specifies an action +## default_folder +New attribute added to bitops.config.yaml to define the default folder name. This attribute is evaluated when building a bitops custom image. + +**New method** +``` +bitops: + default_folder: _default +``` + +**Reasoning for the change** +This provides more control to the bitops image builder. + # Plugins ## Ansible diff --git a/docs/operations-repo-structure.md b/docs/operations-repo-structure.md index 88edf0ea..2a7e3268 100644 --- a/docs/operations-repo-structure.md +++ b/docs/operations-repo-structure.md @@ -50,7 +50,7 @@ Sometimes it is useful to have directories in your operations repo that are not BitOps allows you to name your environment directories whatever you want. However, to better reason about which directories are environments and which aren't, a good convention is to prefix any non-deployable-environment directory with an underscore (e.g. `_scripts` or `_terraform`). -The directory `_default` is special in BitOps. This directory is merged into your enviroment directory before deployment. +The directory `_default` is special in BitOps. This directory is merged into your environment directory before deployment. You can control the default folder name through an environment variable `BITOPS_DEFAULT_FOLDER` or through a bitops configuration attribute `bitops.default_folder`. #### Tool directories Within an environment directory are tool directories which group supported tools by name. Each of these directories is optional. For example, if your application only requires `terraform/` to execute, you do not need an `ansible/`, `cloudformation/` or `helm/` directory in your environment. diff --git a/docs/plugins.md b/docs/plugins.md index 30f34899..9fd8f00c 100644 --- a/docs/plugins.md +++ b/docs/plugins.md @@ -42,7 +42,7 @@ bitops: filename: bitops-run # log filename err: bitops.logs # error logs filename path: /var/logs/bitops # path to log folder - opsrepo_root_default_dir: _default + default_folder: _default plugins: aws: source: https://github.com/bitops-plugins/aws diff --git a/prebuilt-config/aws-ansible/bitops.config.yaml b/prebuilt-config/aws-ansible/bitops.config.yaml index 7f652137..16d69c99 100644 --- a/prebuilt-config/aws-ansible/bitops.config.yaml +++ b/prebuilt-config/aws-ansible/bitops.config.yaml @@ -13,7 +13,7 @@ bitops: filename: bitops-run # log filename err: bitops.logs # error logs filename path: /var/logs/bitops # path to log folder - opsrepo_root_default_dir: _default + default_folder: _default plugins: aws: source: https://github.com/bitops-plugins/aws diff --git a/prebuilt-config/aws-helm/bitops.config.yaml b/prebuilt-config/aws-helm/bitops.config.yaml index e9b77e3b..4b018bf3 100644 --- a/prebuilt-config/aws-helm/bitops.config.yaml +++ b/prebuilt-config/aws-helm/bitops.config.yaml @@ -13,7 +13,7 @@ bitops: filename: bitops-run # log filename err: bitops.logs # error logs filename path: /var/logs/bitops # path to log folder - opsrepo_root_default_dir: _default + default_folder: _default plugins: aws: source: https://github.com/bitops-plugins/aws diff --git a/prebuilt-config/aws-terraform/bitops.config.yaml b/prebuilt-config/aws-terraform/bitops.config.yaml index d324c512..256255dc 100644 --- a/prebuilt-config/aws-terraform/bitops.config.yaml +++ b/prebuilt-config/aws-terraform/bitops.config.yaml @@ -13,7 +13,7 @@ bitops: filename: bitops-run # log filename err: bitops.logs # error logs filename path: /var/logs/bitops # path to log folder - opsrepo_root_default_dir: _default + default_folder: _default plugins: aws: source: https://github.com/bitops-plugins/aws diff --git a/prebuilt-config/example-plugin/bitops.config.yaml b/prebuilt-config/example-plugin/bitops.config.yaml index 77632c38..9a15c173 100644 --- a/prebuilt-config/example-plugin/bitops.config.yaml +++ b/prebuilt-config/example-plugin/bitops.config.yaml @@ -13,7 +13,7 @@ bitops: filename: bitops-run # log filename err: bitops.logs # error logs filename path: /var/logs/bitops # path to log folder - opsrepo_root_default_dir: _default + default_folder: _default plugins: example-plugin: source: https://github.com/bitops-plugins/example-plugin diff --git a/prebuilt-config/omnibus/bitops.config.yaml b/prebuilt-config/omnibus/bitops.config.yaml index eea0dc78..e390cf8d 100644 --- a/prebuilt-config/omnibus/bitops.config.yaml +++ b/prebuilt-config/omnibus/bitops.config.yaml @@ -13,7 +13,7 @@ bitops: filename: bitops-run # log filename err: bitops.logs # error logs filename path: /var/logs/bitops # path to log folder - opsrepo_root_default_dir: _default + default_folder: _default plugins: aws: source: https://github.com/bitops-plugins/aws diff --git a/scripts/plugins/deploy_plugins.py b/scripts/plugins/deploy_plugins.py index 3d03578b..35a06896 100644 --- a/scripts/plugins/deploy_plugins.py +++ b/scripts/plugins/deploy_plugins.py @@ -19,7 +19,6 @@ def Deploy_Plugins(): #~#~#~#~#~#~# STAGE 1 - ENVIRONMENT LOADING #~#~#~#~#~#~# # Temp directory setup temp_dir = tempfile.mkdtemp() - bitops_default_dir_configuration = DefaultMunch.fromDict(bitops_build_configuration.bitops.opsrepo_root_default_dir, None) bitops_deployment_configuration = DefaultMunch.fromDict(bitops_build_configuration.bitops.deployments, None) bitops_dir = "/opt/bitops" @@ -49,7 +48,7 @@ def Deploy_Plugins(): os.environ["BITOPS_FAIL_FAST"] = str(BITOPS_fast_fail_mode) os.environ["BITOPS_KUBE_CONFIG_FILE"] = "{}/.kube/config".format(temp_dir) os.environ["PATH"] = PATH - os.environ["BITOPS_DEFAULT_ROOT_DIR"] = bitops_default_dir_configuration + os.environ["BITOPS_DEFAULT_ROOT_DIR"] = BITOPS_default_folder # Global environment evaluation if BITOPS_ENV_environment is None: @@ -79,7 +78,6 @@ def Deploy_Plugins(): \n\t BITOPS_ENVROOT_DIR: [{bitops_envroot_dir}] \ \n\t BITOPS_OPERATIONS_DIR: [{bitops_operations_dir}] \ \n\t BITOPS_SCRIPTS_DIR: [{bitops_scripts_dir}] \ - \n\t BITOPS_DEFAULT_ROOT_DIR: [{bitops_default_dir_configuration}] \ \n#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~# \n \ ".format( temp_dir=temp_dir, @@ -93,7 +91,6 @@ def Deploy_Plugins(): bitops_envroot_dir=bitops_envroot_dir, bitops_operations_dir=bitops_operations_dir, bitops_scripts_dir=bitops_scripts_dir, - bitops_default_dir_configuration=bitops_default_dir_configuration, )) # Loop through deployments and invoke each #~#~#~#~#~#~# STAGE 2 - PLUGIN LOADING #~#~#~#~#~#~# diff --git a/scripts/plugins/settings.py b/scripts/plugins/settings.py index 75f355a5..d184648f 100644 --- a/scripts/plugins/settings.py +++ b/scripts/plugins/settings.py @@ -36,7 +36,7 @@ BITOPS_ENV_logging_level = os.environ.get("BITOPS_LOGGING_LEVEL") BITOPS_ENV_plugin_dir = os.environ.get("BITOPS_PLUGIN_DIR") -BITOPS_ENV_default_folder = os.environ.get("BITOPS_DEFAULT_FOLDER_NAME") +BITOPS_ENV_default_folder = os.environ.get("BITOPS_DEFAULT_FOLDER") BITOPS_ENV_environment = os.environ.get("BITOPS_ENVIRONMENT", None) BITOPS_ENV_timeout = os.environ.get("BITOPS_TIMEOUT") @@ -88,7 +88,7 @@ if BITOPS_ENV_default_folder is not None \ else bitops_build_configuration.bitops.default_folder \ if bitops_build_configuration.bitops.default_folder is not None \ - else "default" + else "_default" BITOPS_timeout = BITOPS_ENV_timeout \ if BITOPS_ENV_timeout is not None \