Skip to content

Commit

Permalink
feat: Optimizes feature version configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
dploeger committed Aug 19, 2024
1 parent 44d3c32 commit 69aa73d
Show file tree
Hide file tree
Showing 16 changed files with 76 additions and 76 deletions.
85 changes: 45 additions & 40 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ This would install the version 3.5.1 of Helm and version 1.1.9 of terraform. (Ku
version of kubectl, e.g. using az aks install-cli)

**Note**: Please see the feature documentation below if a feature supports specifying a version string. All version
strings need to be provided in semver format (f.e. 1.2.3), the feature installers will take care about prefixes for
strings need to be provided in semver format (i.e. 1.2.3), the feature installers will take care about prefixes for
download URLs, if required.

## Using Kubernetes (Preview)
Expand Down Expand Up @@ -371,7 +371,7 @@ Installs and configures the [Fish Shell](https://fishshell.com/) with configured

#### Configuration

* USE_fish: Enable this feature (it's recommended to use the FEATURES variable instead)
* USE_fish: Enable this feature (or use the FEATURES variable instead)
* DEBUG_fish: Debug this feature

### <a id="azcopy"></a> AzCopy
Expand All @@ -380,7 +380,7 @@ Installs [AzCopy](https://github.com/Azure/azure-storage-azcopy)

#### Configuration

* USE_azcopy: Enable this feature (it's recommended to use the FEATURES variable instead)
* USE_azcopy: Enable this feature (or use the FEATURES variable instead)
* DEBUG_azcopy: Debug this feature

### <a id="ca-certificates"></a> CA-Certificates
Expand All @@ -389,7 +389,7 @@ Adds specified trusted certificate authorities into the container

#### Configuration

* USE_ca-certificates: Enable this feature (it's recommended to use the FEATURES variable instead)
* USE_ca-certificates: Enable this feature (or use the FEATURES variable instead)
* DEBUG_ca-certificates: Debug this feature
* Add a volume mount to the `volumes:` section of docker compose like this:
(...)
Expand All @@ -407,7 +407,7 @@ Adds specified trusted certificate authorities into the container

#### Configuration

* USE_certificates: Enable this feature (it's recommended to use the FEATURES variable instead)
* USE_certificates: Enable this feature (or use the FEATURES variable instead)
* DEBUG_certificates: Debug this feature
* Add a volume mount to the `volumes:` section of docker compose like this:
(...)
Expand All @@ -425,18 +425,17 @@ Installs the cert-manager Command Line Tool

#### Configuration

* USE_cmctl: Enable this feature (it's recommended to use the FEATURES variable instead)
* USE_cmctl: Enable this feature (or use the FEATURES variable instead)
* CMCTL_VERSION: Version to install (or use the FEATURES variable instead)
* DEBUG_cmctl: Debug this feature
* Environment CMCTL_VERSION: Version of cmctl to install (optional)
Defaults to `latest`

### <a id="direnv"></a> Direnv

Installs [Direnv](https://direnv.net/)

#### Configuration

* USE_direnv: Enable this feature (it's recommended to use the FEATURES variable instead)
* USE_direnv: Enable this feature (or use the FEATURES variable instead)
* DEBUG_direnv: Debug this feature

### <a id="helm"></a> Helm
Expand All @@ -445,17 +444,17 @@ Installs [Helm](https://helm.sh)

#### Configuration

* USE_helm: Enable this feature (it's recommended to use the FEATURES variable instead)
* USE_helm: Enable this feature (or use the FEATURES variable instead)
* HELM_VERSION: Version to install (or use the FEATURES variable instead)
* DEBUG_helm: Debug this feature
* Environment HELM_VERSION (required): Valid Helm version to install (e.g. 1.5.4)

### <a id="jq"></a> JQ

Installs the [JSON parser and processor jq](https://stedolan.github.io/jq/)

#### Configuration

* USE_jq: Enable this feature (it's recommended to use the FEATURES variable instead)
* USE_jq: Enable this feature (or use the FEATURES variable instead)
* DEBUG_jq: Debug this feature

### <a id="k9s"></a> k9s
Expand All @@ -464,9 +463,9 @@ Installs [k9s](https://k9scli.io/)

#### Configuration

* USE_k9s: Enable this feature (it's recommended to use the FEATURES variable instead)
* USE_k9s: Enable this feature (or use the FEATURES variable instead)
* K9S_VERSION: Version to install (or use the FEATURES variable instead)
* DEBUG_k9s: Debug this feature
* Environment K9S_VERSION (required): Valid k9s version to install

### <a id="kc"></a> kc Quick Kubernetes Context switch

Expand All @@ -475,7 +474,7 @@ Installs [kc](https://github.com/dodevops/cloudcontrol/blob/master/feature/kc/kc

#### Configuration

* USE_kc: Enable this feature (it's recommended to use the FEATURES variable instead)
* USE_kc: Enable this feature (or use the FEATURES variable instead)
* DEBUG_kc: Debug this feature

### <a id="krew"></a> krew
Expand All @@ -484,9 +483,9 @@ Installs [Krew](https://krew.sigs.k8s.io/)

#### Configuration

* USE_krew: Enable this feature (it's recommended to use the FEATURES variable instead)
* USE_krew: Enable this feature (or use the FEATURES variable instead)
* KREW_VERSION: Version to install (or use the FEATURES variable instead)
* DEBUG_krew: Debug this feature
* Environment KREW_VERSION (optional): Valid Krew version to install (defaults to latest)
* Environment KREW_PLUGINS (optional): A comma separated list of kubectl plugins to install via krew

### <a id="kubectlnodeshell"></a> Kubectlnodeshell
Expand All @@ -495,7 +494,7 @@ Installs [kubectl node-shell](https://github.com/kvaps/kubectl-node-shell)

#### Configuration

* USE_kubectlnodeshell: Enable this feature (it's recommended to use the FEATURES variable instead)
* USE_kubectlnodeshell: Enable this feature (or use the FEATURES variable instead)
* DEBUG_kubectlnodeshell: Debug this feature

### <a id="kubernetes"></a> Kubernetes
Expand All @@ -504,7 +503,7 @@ Installs and configures [kubernetes](https://kubernetes.io/docs/reference/kubect

#### Configuration

* USE_kubernetes: Enable this feature (it's recommended to use the FEATURES variable instead)
* USE_kubernetes: Enable this feature (or use the FEATURES variable instead)
* DEBUG_kubernetes: Debug this feature
* Environment KUBECTL_DEFAULT_CONTEXT: Sets the default kubectl context after initialisation and when using the
k8s-relogin script
Expand Down Expand Up @@ -553,7 +552,7 @@ Installs additional packages into the container

#### Configuration

* USE_packages: Enable this feature (it's recommended to use the FEATURES variable instead)
* USE_packages: Enable this feature (or use the FEATURES variable instead)
* DEBUG_packages: Debug this feature
* Environment PACKAGES: A whitespace separated list of packages to install. The packages will be installed with the flavour's default package manager.

Expand All @@ -563,17 +562,17 @@ Installs [Packer](https://packer.io)

#### Configuration

* USE_packer: Enable this feature (it's recommended to use the FEATURES variable instead)
* USE_packer: Enable this feature (or use the FEATURES variable instead)
* PACKER_VERSION: Version to install (or use the FEATURES variable instead)
* DEBUG_packer: Debug this feature
* Environment PACKER_VERSION (required): Valid Packer version to install (e.g. 1.5.4)

### <a id="run"></a> Run

Runs commands inside the shell when entering the cloud control container

#### Configuration

* USE_run: Enable this feature (it's recommended to use the FEATURES variable instead)
* USE_run: Enable this feature (or use the FEATURES variable instead)
* DEBUG_run: Debug this feature
* Environment RUN_COMMANDS: Valid shell commands to run

Expand All @@ -583,9 +582,9 @@ Installs [sops](https://github.com/getsops/sops)

#### Configuration

* USE_sops: Enable this feature (it's recommended to use the FEATURES variable instead)
* USE_sops: Enable this feature (or use the FEATURES variable instead)
* SOPS_VERSION: Version to install (or use the FEATURES variable instead)
* DEBUG_sops: Debug this feature
* Environment SOPS_VERSION (required): Valid sops version (e.g. 3.8.1)
* Environment specific for the key you use, see [sops documentation](https://github.com/getsops/sops?tab=readme-ov-file#22encrypting-using-age)

### <a id="stern"></a> Stern
Expand All @@ -595,27 +594,28 @@ Installs [stern](https://github.com/stern/stern), a multi pod and container log

#### Configuration

* USE_stern: Enable this feature (it's recommended to use the FEATURES variable instead)
* USE_stern: Enable this feature (or use the FEATURES variable instead)
* STERN_VERSION: Version to install (or use the FEATURES variable instead)
* DEBUG_stern: Debug this feature
* Environment STERN_VERSION (required): Valid Stern version (e.g. 1.21.0)

### <a id="tanzucli"></a> Tanzu CLI

Installs the [Tanzu CLI](https://github.com/vmware-tanzu/tanzu-cli)

#### Configuration

* USE_tanzucli: Enable this feature (it's recommended to use the FEATURES variable instead)
* USE_tanzucli: Enable this feature (or use the FEATURES variable instead)
* TANZUCLI_VERSION: Version to install (or use the FEATURES variable instead)
* DEBUG_tanzucli: Debug this feature
* Environment TANZU_CLI_VERSION: Tanzu CLI version to install (required)

### <a id="terraform"></a> Terraform

Installs and configures [Terraform](https://terraform.io)

#### Configuration

* USE_terraform: Enable this feature (it's recommended to use the FEATURES variable instead)
* USE_terraform: Enable this feature (or use the FEATURES variable instead)
* TERRAFORM_VERSION: Version to install (or use the FEATURES variable instead)
* DEBUG_terraform: Debug this feature
* Add a volume mount to the `volumes:` section of docker compose like this:
(...)
Expand All @@ -626,7 +626,6 @@ Installs and configures [Terraform](https://terraform.io)
* Volume-target /credentials.terraform: A Terraform variable file holding sensitive information when working with terraform (e.g.
Terraform app secrets, etc.). If something different than /credentials.terraform is used, environment TERRAFORM_CREDENTIALS_PATH
needs to be set to this path
* Environment TERRAFORM_VERSION (required): A valid terraform version to install (e.g. 0.12.17)
* Environment TERRAFORM_PATH: Volume target for terraform base directory (optional). Defaults to `/terraform`. If something different
than the default is used, the volume-target needs to be adapted to the same directory
* Environment TERRAFORM_CREDENTIALS_PATH: Volume target for terraform credentials (optional). Defaults to `/terraform`. If something
Expand All @@ -642,17 +641,17 @@ Installs [Terragrunt](https://github.com/gruntwork-io/terragrunt)

#### Configuration

* USE_terragrunt: Enable this feature (it's recommended to use the FEATURES variable instead)
* USE_terragrunt: Enable this feature (or use the FEATURES variable instead)
* TERRAGRUNT_VERSION: Version to install (or use the FEATURES variable instead)
* DEBUG_terragrunt: Debug this feature
* Environment TERRAGRUNT_VERSION (required): Valid version of terragrunt to install

### <a id="timezone"></a> Timezone configuration

Configures the container's timezone

#### Configuration

* USE_timezone: Enable this feature (it's recommended to use the FEATURES variable instead)
* USE_timezone: Enable this feature (or use the FEATURES variable instead)
* DEBUG_timezone: Debug this feature
* Environment TZ: The timezone to use

Expand All @@ -662,17 +661,17 @@ Installs the [Velero](https://velero.io) kubernetes backup CLI

#### Configuration

* USE_velero: Enable this feature (it's recommended to use the FEATURES variable instead)
* USE_velero: Enable this feature (or use the FEATURES variable instead)
* VELERO_VERSION: Version to install (or use the FEATURES variable instead)
* DEBUG_velero: Debug this feature
* Environment VELERO_VERSION (required): Valid velero version to install (e.g. 1.4.2)

### <a id="vim"></a> Vim

Installs [Vim](https://www.vim.org/)

#### Configuration

* USE_vim: Enable this feature (it's recommended to use the FEATURES variable instead)
* USE_vim: Enable this feature (or use the FEATURES variable instead)
* DEBUG_vim: Debug this feature

### <a id="yq"></a> YQ
Expand All @@ -681,9 +680,9 @@ Installs the [YAML parser and processor yq](https://github.com/mikefarah/yq)

#### Configuration

* USE_yq: Enable this feature (it's recommended to use the FEATURES variable instead)
* USE_yq: Enable this feature (or use the FEATURES variable instead)
* YQ_VERSION: Version to install (or use the FEATURES variable instead)
* DEBUG_yq: Debug this feature
* Environment YQ_VERSION (required): Valid YQ version to install (e.g. 4.5.0)


## Development
Expand Down Expand Up @@ -867,7 +866,13 @@ flowchart TD
click F "https://github.com/dodevops/cloudcontrol/blob/develop/.github/workflows/test.yml" "Test workflow"
click H "https://github.com/dodevops/cloudcontrol/blob/develop/.github/workflows/release.yml" "Release workflow"
```mermaid
workflow"
"
```mermaid
flows/docs.yml" "Docs workflow"
click C "https://github.com/dodevops/cloudcontrol/blob/develop/.github/workflows/image.yml" "Image workflow"
click E "https://github.com/dodevops/cloudcontrol/blob/develop/.github/workflows/check_commits.yml" "Check workflow"
click F "https://github.com/dodevops/cloudcontrol/blob/develop/.github/workflows/test.yml" "Test workflow"
click H "https://github.com/dodevops/cloudcontrol/blob/develop/.github/workflows/release.yml" "Release workflow"
```mermaid
ase workflow"
```mermaid
13 changes: 8 additions & 5 deletions README.md.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ This would install the version 3.5.1 of Helm and version 1.1.9 of terraform. (Ku
version of kubectl, e.g. using az aks install-cli)

**Note**: Please see the feature documentation below if a feature supports specifying a version string. All version
strings need to be provided in semver format (f.e. 1.2.3), the feature installers will take care about prefixes for
strings need to be provided in semver format (i.e. 1.2.3), the feature installers will take care about prefixes for
download URLs, if required.

## Using Kubernetes (Preview)
Expand Down Expand Up @@ -274,7 +274,10 @@ environment variable in the docker-compose file. Then you can debug with the run

#### Configuration

* USE_{{ trimPrefix "_" $name }}: Enable this feature (it's recommended to use the FEATURES variable instead)
* USE_{{ trimPrefix "_" $name }}: Enable this feature (or use the FEATURES variable instead)
{{- if $feature.RequiresVersion }}
* {{ $name | upper }}_VERSION: Version to install (or use the FEATURES variable instead)
{{- end }}
* DEBUG_{{ trimPrefix "_" $name }}: Debug this feature
{{- range $feature.Configuration }}
* {{ indent 2 . | trim }}
Expand Down Expand Up @@ -320,9 +323,9 @@ to set for the specific environment variable. If a configuration option is requi
environment declaration using `(required)` after its name and check if the variable is set in your installation script
and break accordingly if not.

If your feature needs a version specification, the recommended way is to use the environment variable
`[FEATURE NAME]_VERSION`. This variable is also filled if the *CloudControl* user uses the FEATURES-variable approach
to enable features.
If your feature needs a version specification, set "requiresVersion" to true in the feature descriptor. This will
enable the use of an environment variable `[FEATURE NAME]_VERSION`. This variable is also filled if the *CloudControl*
user uses the FEATURES-variable approach to enable features.

### Installer utilities

Expand Down
3 changes: 3 additions & 0 deletions feature/.template/feature.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,6 @@ configuration:
#- |
# Environment EXAMPLE_ENVIRONMENT: This environment variable is used in the feature to do xyz (optional)
# Defaults to `abc`

# If your feature requires a version (exposed as <FEATURE>_VERSION to your installer script), set this to true
requiresVersion: false
5 changes: 1 addition & 4 deletions feature/cmctl/feature.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
icon: "📨"
title: "cmctl"
description: "Installs the cert-manager Command Line Tool"
configuration:
- |
Environment CMCTL_VERSION: Version of cmctl to install (optional)
Defaults to `latest`
requiresVersion: true
3 changes: 1 addition & 2 deletions feature/helm/feature.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
icon: "⛵️"
title: "Helm"
description: "Installs [Helm](https://helm.sh)"
configuration:
- "Environment HELM_VERSION (required): Valid Helm version to install (e.g. 1.5.4)"
requiresVersion: true
3 changes: 1 addition & 2 deletions feature/k9s/feature.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
icon: "🐾"
title: "k9s"
description: "Installs [k9s](https://k9scli.io/)"
configuration:
- "Environment K9S_VERSION (required): Valid k9s version to install"
requiresVersion: true
2 changes: 1 addition & 1 deletion feature/krew/feature.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ icon: "🟦"
title: "krew"
description: "Installs [Krew](https://krew.sigs.k8s.io/)"
configuration:
- "Environment KREW_VERSION (optional): Valid Krew version to install (defaults to latest)"
- "Environment KREW_PLUGINS (optional): A comma separated list of kubectl plugins to install via krew"
requiresVersion: true
3 changes: 1 addition & 2 deletions feature/packer/feature.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
icon: "📦"
title: "Packer"
description: "Installs [Packer](https://packer.io)"
configuration:
- "Environment PACKER_VERSION (required): Valid Packer version to install (e.g. 1.5.4)"
requiresVersion: true
2 changes: 1 addition & 1 deletion feature/sops/feature.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ icon: "🔑"
title: "sops"
description: "Installs [sops](https://github.com/getsops/sops)"
configuration:
- "Environment SOPS_VERSION (required): Valid sops version (e.g. 3.8.1)"
- "Environment specific for the key you use, see [sops documentation](https://github.com/getsops/sops?tab=readme-ov-file#22encrypting-using-age)"
requiresVersion: true
3 changes: 1 addition & 2 deletions feature/stern/feature.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@ icon: "📜"
title: "Stern"
description: |
Installs [stern](https://github.com/stern/stern), a multi pod and container log tailing for Kubernetes
configuration:
- "Environment STERN_VERSION (required): Valid Stern version (e.g. 1.21.0)"
requiresVersion: true
4 changes: 1 addition & 3 deletions feature/tanzucli/feature.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,4 @@ title: "Tanzu CLI"

description: "Installs the [Tanzu CLI](https://github.com/vmware-tanzu/tanzu-cli)"

configuration:
- |
Environment TANZU_CLI_VERSION: Tanzu CLI version to install (required)
requiresVersion: true
Loading

0 comments on commit 69aa73d

Please sign in to comment.