refactoring clj-cljs image install.sh

This commit is contained in:
Mirco 2024-04-12 16:02:27 +02:00
parent bf843edb80
commit 48bbbe6f6e

View file

@ -6,7 +6,7 @@ function main() {
upgradeSystem
mkdir -p /usr/share/man/man1
apt-get -qqy install openjdk-17-jre-headless leiningen curl
apt-get -qqy install curl openjdk-17-jre-headless leiningen
# shadow-cljs
npm install -g npm
@ -15,14 +15,14 @@ function main() {
# download kubeconform & graalvm
kubeconform_version="0.6.4"
curl -SsLo /tmp/kubeconform.tar.gz https://github.com/yannh/kubeconform/releases/download/v${kubeconform_version}/kubeconform-linux-amd64.tar.gz
curl -SsLo /tmp/kubeconform-linux-amd64.tar.gz https://github.com/yannh/kubeconform/releases/download/v${kubeconform_version}/kubeconform-linux-amd64.tar.gz
curl -SsLo /tmp/CHECKSUMS https://github.com/yannh/kubeconform/releases/download/v${kubeconform_version}/CHECKSUMS
# checksum kubeconform
checksum
# install kubeconform
tar -C /usr/local/bin -xf /tmp/kubeconform.tar.gz --exclude=LICENSE
tar -C /usr/local/bin -xf /tmp/kubeconform-linux-amd64.tar.gz --exclude=LICENSE
#install pyb
apt-get -qqy install python3 python3-pip git
@ -36,15 +36,9 @@ function main() {
}
function checksum() {
checksum_var=$(awk '{print $1}' /tmp/CHECKSUMS|sed -n '2p')
sha256sum_var=$(sha256sum /tmp/kubeconform.tar.gz|awk '{print $1}')
if [ $checksum_var == $sha256sum_var ]; then
echo "Kubeconform checksum verification succesful"
else
echo "Failure in kubeconform checksum verification"
exit 1
fi
awk '{print $1 " /tmp/" $2}' /tmp/CHECKSUMS|sed -n '2p' > /tmp/kubeconform-checksum
cat /tmp/kubeconform-checksum
sha256sum -c --status /tmp/kubeconform-checksum
}
source /tmp/install_functions_debian.sh