From ed87a95b111aad81c483f85fbe35e9a6c5d59294 Mon Sep 17 00:00:00 2001 From: Dennis Ploeger Date: Thu, 27 Jun 2024 08:08:19 +0200 Subject: [PATCH 1/2] feat: Include cmctl Also includes a patch to build.sh to make it more reliable. Fixes #140 --- build.sh | 6 ++++-- feature/cmctl/feature.yaml | 7 +++++++ feature/cmctl/goss/goss.yaml | 6 ++++++ feature/cmctl/install.sh | 9 +++++++++ 4 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 feature/cmctl/feature.yaml create mode 100644 feature/cmctl/goss/goss.yaml create mode 100644 feature/cmctl/install.sh diff --git a/build.sh b/build.sh index d171681..53b513d 100644 --- a/build.sh +++ b/build.sh @@ -1,5 +1,7 @@ #!/usr/bin/env bash +set -euo pipefail + # CloudControl build script # Usage: # @@ -27,8 +29,8 @@ for FLAVOUR in ${FLAVOURS} do cat build/Dockerfile.prefix > Dockerfile cat "flavour/${FLAVOUR}/Dockerfile.flavour" >> Dockerfile - cat build/Dockerfile.suffix.mo | docker run --rm -i -e FLAVOUR=${FLAVOUR} -e BUILD_DATE=$(date -Iseconds) metal3d/mo >> Dockerfile - docker build --pull . -t "ghcr.io/dodevops/cloudcontrol-${FLAVOUR}:${TAG}" + cat build/Dockerfile.suffix.mo | docker run --rm -i -e FLAVOUR=${FLAVOUR} -e BUILD_DATE=$(date -Iseconds) ghcr.io/tests-always-included/mo:3.0.5 >> Dockerfile + docker build --pull . --no-cache -t "ghcr.io/dodevops/cloudcontrol-${FLAVOUR}:${TAG}" done if [ -e Dockerfile.sav ] ; then diff --git a/feature/cmctl/feature.yaml b/feature/cmctl/feature.yaml new file mode 100644 index 0000000..765eca6 --- /dev/null +++ b/feature/cmctl/feature.yaml @@ -0,0 +1,7 @@ +icon: "📨" +title: "cmctl" +description: "Installs the cert-manager Command Line Tool" +configuration: + - | + Environment CMCTL_VERSION: Version of cmctl to install (optional) + Defaults to `latest` diff --git a/feature/cmctl/goss/goss.yaml b/feature/cmctl/goss/goss.yaml new file mode 100644 index 0000000..8a02ad4 --- /dev/null +++ b/feature/cmctl/goss/goss.yaml @@ -0,0 +1,6 @@ +command: + cmctl: + exec: "/home/cloudcontrol/bin/cmctl version --client" + stdout: + - "Client Version" + exit-status: 0 diff --git a/feature/cmctl/install.sh b/feature/cmctl/install.sh new file mode 100644 index 0000000..6d6e489 --- /dev/null +++ b/feature/cmctl/install.sh @@ -0,0 +1,9 @@ +. /feature-installer-utils.sh + +# Prepare a workspace for installing the feature +prepare + +download "https://github.com/cert-manager/cmctl/releases/${CMCTL_VERSION:-latest}/download/cmctl_linux_$(getPlatform)" cmctl +execHandle "Making cmctl executable" chmod +x cmctl +execHandle "Copying tool to ${BINPATH}" cp cmctl "${BINPATH}" +cleanup \ No newline at end of file From 02273558c8d3ccba238ad1584b1a924b4e45b80b Mon Sep 17 00:00:00 2001 From: DO! DevOps bot Date: Thu, 27 Jun 2024 06:08:46 +0000 Subject: [PATCH 2/2] docs: Automatic docs update --- README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/README.md b/README.md index 5f3bbc0..0f2f92d 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,7 @@ Following features and tools are supported: * 🐟 Fish Shell * 📷 AzCopy * 🪪 Certificates +* 📨 cmctl * ⚙️ Direnv * ⛵️ Helm * 🛠 JQ @@ -54,6 +55,7 @@ Following features and tools are supported: * [Fish Shell](#_fish) * [AzCopy](#azcopy) * [Certificates](#certificates) + * [cmctl](#cmctl) * [Direnv](#direnv) * [Helm](#helm) * [JQ](#jq) @@ -395,6 +397,17 @@ Adds specified trusted certificate authorities into the container (optional). Defaults to `/certificates`. If something different than the default is used, the volume-target needs to be adapted to the same directory +### cmctl + +Installs the cert-manager Command Line Tool + +#### Configuration + +* USE_cmctl: Enable this feature +* DEBUG_cmctl: Debug this feature +* Environment CMCTL_VERSION: Version of cmctl to install (optional) + Defaults to `latest` + ### Direnv Installs [Direnv](https://direnv.net/)