mirror of
https://github.com/rwxrob/dot
synced 2024-11-16 21:25:29 +00:00
Add OPA install-conftest
This commit is contained in:
parent
f621e33a85
commit
04a5564606
17
install/ubuntu/install-conftest
Executable file
17
install/ubuntu/install-conftest
Executable 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"
|
Loading…
Reference in New Issue
Block a user