Add OPA install-conftest

This commit is contained in:
rwxrob 2022-06-15 17:02:51 -04:00
parent f621e33a85
commit 04a5564606
No known key found for this signature in database
GPG Key ID: 2B9111F33082AE77

17
install/ubuntu/install-conftest Executable file
View File

@ -0,0 +1,17 @@
#!/usr/bin/env bash
set -e
user="open-policy-agent"
repo="conftest"
os=$(uname -s)
arch=$(uname -m)
latest=$(curl -sSL "https://api.github.com/repos/$user/$repo/releases/latest" | jq -r .name)
rel="https://github.com/$user/$repo/releases/download/$latest/${repo}_${latest//v/}_${os^}_${arch}.tar.gz"
dir=$(mktemp -d)
curl -sSL "$rel" -o "$dir/$repo.tar.gz"
cd "$dir"
tar xzf "$repo.tar.gz"
mv "$dir/$repo" "$HOME/.local/bin"
rm -rf "$dir"