Skip to content

Commit

Permalink
feat: Adding sops feature
Browse files Browse the repository at this point in the history
  • Loading branch information
timdeluxe committed Jun 13, 2024
1 parent ceb9a18 commit 251dad5
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 0 deletions.
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ Following features and tools are supported:
* 📦 Packages
* 📦 Packer
* 👟 Run
* 🔑 sops
* 📜 Stern
* 🌏 Terraform
* 🐗 Terragrunt
Expand Down Expand Up @@ -64,6 +65,7 @@ Following features and tools are supported:
* [Packages](#packages)
* [Packer](#packer)
* [Run](#run)
* [sops](#sops)
* [Stern](#stern)
* [Terraform](#terraform)
* [Terragrunt](#terragrunt)
Expand Down Expand Up @@ -540,6 +542,17 @@ Runs commands inside the shell when entering the cloud control container
* DEBUG_run: Debug this feature
* Environment RUN_COMMANDS: Valid shell commands to run

### <a id="sops"></a> sops

Installs [sops](https://github.com/getsops/sops)

#### Configuration

* USE_sops: Enable this feature
* 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

Installs [stern](https://github.com/stern/stern), a multi pod and container log tailing for Kubernetes
Expand Down
6 changes: 6 additions & 0 deletions feature/sops/feature.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
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)"
1 change: 1 addition & 0 deletions feature/sops/goss/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
SOPS_VERSION=3.8.1
6 changes: 6 additions & 0 deletions feature/sops/goss/goss.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
command:
sops:
exec: "/home/cloudcontrol/bin/sops --version"
exit-status: 0
stdout:
- "sops"
23 changes: 23 additions & 0 deletions feature/sops/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
. /feature-installer-utils.sh

if [ -z "${SOPS_VERSION}" ]
then
echo "The sops feature requires a version set using SOPS_VERSION. See https://github.com/getsops/sops/releases/ for valid versions"
exit 1
fi

SOPS_VERSION=$(checkAndCleanVersion "${SOPS_VERSION}")

TEMPDIR=$(mktemp -d)
cd "${TEMPDIR}" || exit

execHandle "Downloading sops" curl -f -s -L "https://github.com/getsops/sops/releases/download/v${SOPS_VERSION}/sops-v${SOPS_VERSION}.linux.$(getPlatform)" --output sops
execHandle "Installing sops" mv sops /home/cloudcontrol/bin
execHandle "Making sops executable" chmod +x /home/cloudcontrol/bin/sops

cd - &>/dev/null || exit
rm -rf "${TEMPDIR}"




0 comments on commit 251dad5

Please sign in to comment.