From 48bbbe6f6e3351d1266e330cbd49d2342f972e44 Mon Sep 17 00:00:00 2001 From: Mirco Date: Fri, 12 Apr 2024 16:02:27 +0200 Subject: [PATCH] refactoring clj-cljs image install.sh --- .../clj-cljs/image/resources/install.sh | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/infrastructure/clj-cljs/image/resources/install.sh b/infrastructure/clj-cljs/image/resources/install.sh index 224695f..a679f79 100755 --- a/infrastructure/clj-cljs/image/resources/install.sh +++ b/infrastructure/clj-cljs/image/resources/install.sh @@ -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