Skip to content

Commit 251dad5

Browse files
committed
feat: Adding sops feature
1 parent ceb9a18 commit 251dad5

5 files changed

Lines changed: 49 additions & 0 deletions

File tree

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ Following features and tools are supported:
3030
* 📦 Packages
3131
* 📦 Packer
3232
* 👟 Run
33+
* 🔑 sops
3334
* 📜 Stern
3435
* 🌏 Terraform
3536
* 🐗 Terragrunt
@@ -64,6 +65,7 @@ Following features and tools are supported:
6465
* [Packages](#packages)
6566
* [Packer](#packer)
6667
* [Run](#run)
68+
* [sops](#sops)
6769
* [Stern](#stern)
6870
* [Terraform](#terraform)
6971
* [Terragrunt](#terragrunt)
@@ -540,6 +542,17 @@ Runs commands inside the shell when entering the cloud control container
540542
* DEBUG_run: Debug this feature
541543
* Environment RUN_COMMANDS: Valid shell commands to run
542544

545+
### <a id="sops"></a> sops
546+
547+
Installs [sops](https://github.com/getsops/sops)
548+
549+
#### Configuration
550+
551+
* USE_sops: Enable this feature
552+
* DEBUG_sops: Debug this feature
553+
* Environment SOPS_VERSION (required): Valid sops version (e.g. 3.8.1)
554+
* Environment specific for the key you use, see [sops documentation](https://github.com/getsops/sops?tab=readme-ov-file#22encrypting-using-age)
555+
543556
### <a id="stern"></a> Stern
544557

545558
Installs [stern](https://github.com/stern/stern), a multi pod and container log tailing for Kubernetes

feature/sops/feature.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
icon: "🔑"
2+
title: "sops"
3+
description: "Installs [sops](https://github.com/getsops/sops)"
4+
configuration:
5+
- "Environment SOPS_VERSION (required): Valid sops version (e.g. 3.8.1)"
6+
- "Environment specific for the key you use, see [sops documentation](https://github.com/getsops/sops?tab=readme-ov-file#22encrypting-using-age)"

feature/sops/goss/.env

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
SOPS_VERSION=3.8.1

feature/sops/goss/goss.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
command:
2+
sops:
3+
exec: "/home/cloudcontrol/bin/sops --version"
4+
exit-status: 0
5+
stdout:
6+
- "sops"

feature/sops/install.sh

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
. /feature-installer-utils.sh
2+
3+
if [ -z "${SOPS_VERSION}" ]
4+
then
5+
echo "The sops feature requires a version set using SOPS_VERSION. See https://github.com/getsops/sops/releases/ for valid versions"
6+
exit 1
7+
fi
8+
9+
SOPS_VERSION=$(checkAndCleanVersion "${SOPS_VERSION}")
10+
11+
TEMPDIR=$(mktemp -d)
12+
cd "${TEMPDIR}" || exit
13+
14+
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
15+
execHandle "Installing sops" mv sops /home/cloudcontrol/bin
16+
execHandle "Making sops executable" chmod +x /home/cloudcontrol/bin/sops
17+
18+
cd - &>/dev/null || exit
19+
rm -rf "${TEMPDIR}"
20+
21+
22+
23+

0 commit comments

Comments
 (0)