From f96f94efab8a49a82f6d5020f87b225f43776e60 Mon Sep 17 00:00:00 2001 From: Antoine Barthelemy Date: Thu, 24 Oct 2024 16:26:36 +0200 Subject: [PATCH] feat(conftest) --- scripts/conftest.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 scripts/conftest.sh diff --git a/scripts/conftest.sh b/scripts/conftest.sh new file mode 100644 index 0000000..a4673b0 --- /dev/null +++ b/scripts/conftest.sh @@ -0,0 +1,10 @@ +#!/bin/sh +set -o errexit +LATEST_VERSION=$(wget -O - "https://api.github.com/repos/open-policy-agent/conftest/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/' | cut -c 2-) +ARCH=$(arch) +SYSTEM=$(uname) +TMP="/tmp/conftest" +mkdir -p "$TMP" +wget "https://github.com/open-policy-agent/conftest/releases/download/v${LATEST_VERSION}/conftest_${LATEST_VERSION}_${SYSTEM}_${ARCH}.tar.gz" -P "$TMP" +tar xzf "$TMP/conftest_${LATEST_VERSION}_${SYSTEM}_${ARCH}.tar.gz" -C "$TMP" +sudo mv "$TMP/conftest" /usr/local/bin