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 1813db6
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 0 deletions.
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"
22 changes: 22 additions & 0 deletions feature/sops/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
. /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

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




0 comments on commit 1813db6

Please sign in to comment.