Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Adding sops feature #143

Merged
merged 1 commit into from
Jun 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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}"




Loading