babashka/script/install-clojure

28 lines
760 B
Text
Raw Permalink Normal View History

2019-08-09 12:51:42 +00:00
#!/usr/bin/env bash
Use Debian bullseye on CI/CD/Dockerfile (#1005) * Migrate `Dockerfile` to use a bullseye-based image Also, some QoL changes on the `Dockerfile`: - Parametrize GRAALVM_VERSION to make it easier to update - Remove installing programs already included on base image - Remove `deps.edn` from `.dockerignore` since it is necessary to build * Migrate CircleCI to use a bullseye-based image Also some modifications necessary to make it work: - Migrate from `circleci` images to `clojure` since they're out-of-date and also seem to be considered legacy: https://circleci.com/docs/2.0/circleci-images/#legacy-language-images - Remove unnecessary usage of `sudo`, since all commands runs as root - Sync packages with `Dockerfile`. This will make easier to test locally if everything will work (of course, it is not 100% guarantee) * Remove lsof * Remove "Install {Clojure,Leiningen}" steps Already included on the base image. * Do not change directory when downloading GraalVM * Move "Download GraalVM" to script/download-graalvm * Set GRAALVM_HOME correctly * Unbreak mac build * Revert "Set GRAALVM_HOME correctly" This reverts commit 5e2a6158dc28958bda7c2bd58c5597ebe02d6aef. * Set GRAALVM_HOME correctly, take 2 * Improve download-graalvm script * Re-added "Install Clojure" steps * Set amd64 as default GRAALVM_ARCH * Unbreak linux-aarch64 * Ubreak jvm * Do not change directory * Fix yaml * Fix mac/linux-aarch64 * Add missing Clojure * Fix cache * Move GraalVM installation to /tmp * Use script/install-clojure * Use /opt instead of /tmp to install GraalVM * Revert "Use /opt instead of /tmp to install GraalVM" This reverts commit 3cfad03c8ed641bb915ea19953423c43e801eafc. * Use CircleCI's Clojure images again * Go back to installing GraalVM on $HOME
2021-09-13 21:28:13 +00:00
set -euo pipefail
CLOJURE_TOOLS_VERSION="1.11.1.1200"
Use Debian bullseye on CI/CD/Dockerfile (#1005) * Migrate `Dockerfile` to use a bullseye-based image Also, some QoL changes on the `Dockerfile`: - Parametrize GRAALVM_VERSION to make it easier to update - Remove installing programs already included on base image - Remove `deps.edn` from `.dockerignore` since it is necessary to build * Migrate CircleCI to use a bullseye-based image Also some modifications necessary to make it work: - Migrate from `circleci` images to `clojure` since they're out-of-date and also seem to be considered legacy: https://circleci.com/docs/2.0/circleci-images/#legacy-language-images - Remove unnecessary usage of `sudo`, since all commands runs as root - Sync packages with `Dockerfile`. This will make easier to test locally if everything will work (of course, it is not 100% guarantee) * Remove lsof * Remove "Install {Clojure,Leiningen}" steps Already included on the base image. * Do not change directory when downloading GraalVM * Move "Download GraalVM" to script/download-graalvm * Set GRAALVM_HOME correctly * Unbreak mac build * Revert "Set GRAALVM_HOME correctly" This reverts commit 5e2a6158dc28958bda7c2bd58c5597ebe02d6aef. * Set GRAALVM_HOME correctly, take 2 * Improve download-graalvm script * Re-added "Install Clojure" steps * Set amd64 as default GRAALVM_ARCH * Unbreak linux-aarch64 * Ubreak jvm * Do not change directory * Fix yaml * Fix mac/linux-aarch64 * Add missing Clojure * Fix cache * Move GraalVM installation to /tmp * Use script/install-clojure * Use /opt instead of /tmp to install GraalVM * Revert "Use /opt instead of /tmp to install GraalVM" This reverts commit 3cfad03c8ed641bb915ea19953423c43e801eafc. * Use CircleCI's Clojure images again * Go back to installing GraalVM on $HOME
2021-09-13 21:28:13 +00:00
install_dir="${1:-/usr/local}"
2019-08-09 12:51:42 +00:00
mkdir -p "$install_dir"
cd /tmp
Use Debian bullseye on CI/CD/Dockerfile (#1005) * Migrate `Dockerfile` to use a bullseye-based image Also, some QoL changes on the `Dockerfile`: - Parametrize GRAALVM_VERSION to make it easier to update - Remove installing programs already included on base image - Remove `deps.edn` from `.dockerignore` since it is necessary to build * Migrate CircleCI to use a bullseye-based image Also some modifications necessary to make it work: - Migrate from `circleci` images to `clojure` since they're out-of-date and also seem to be considered legacy: https://circleci.com/docs/2.0/circleci-images/#legacy-language-images - Remove unnecessary usage of `sudo`, since all commands runs as root - Sync packages with `Dockerfile`. This will make easier to test locally if everything will work (of course, it is not 100% guarantee) * Remove lsof * Remove "Install {Clojure,Leiningen}" steps Already included on the base image. * Do not change directory when downloading GraalVM * Move "Download GraalVM" to script/download-graalvm * Set GRAALVM_HOME correctly * Unbreak mac build * Revert "Set GRAALVM_HOME correctly" This reverts commit 5e2a6158dc28958bda7c2bd58c5597ebe02d6aef. * Set GRAALVM_HOME correctly, take 2 * Improve download-graalvm script * Re-added "Install Clojure" steps * Set amd64 as default GRAALVM_ARCH * Unbreak linux-aarch64 * Ubreak jvm * Do not change directory * Fix yaml * Fix mac/linux-aarch64 * Add missing Clojure * Fix cache * Move GraalVM installation to /tmp * Use script/install-clojure * Use /opt instead of /tmp to install GraalVM * Revert "Use /opt instead of /tmp to install GraalVM" This reverts commit 3cfad03c8ed641bb915ea19953423c43e801eafc. * Use CircleCI's Clojure images again * Go back to installing GraalVM on $HOME
2021-09-13 21:28:13 +00:00
curl -O -sL "https://download.clojure.org/install/clojure-tools-$CLOJURE_TOOLS_VERSION.tar.gz"
tar xzf "clojure-tools-$CLOJURE_TOOLS_VERSION.tar.gz"
2019-08-09 12:51:42 +00:00
cd clojure-tools
clojure_lib_dir="$install_dir/lib/clojure"
mkdir -p "$clojure_lib_dir/libexec"
cp ./*.jar "$clojure_lib_dir/libexec"
cp deps.edn "$clojure_lib_dir"
cp example-deps.edn "$clojure_lib_dir"
sed -i -e 's@PREFIX@'"$clojure_lib_dir"'@g' clojure
mkdir -p "$install_dir/bin"
cp clojure "$install_dir/bin"
cp clj "$install_dir/bin"
cd /tmp
Use Debian bullseye on CI/CD/Dockerfile (#1005) * Migrate `Dockerfile` to use a bullseye-based image Also, some QoL changes on the `Dockerfile`: - Parametrize GRAALVM_VERSION to make it easier to update - Remove installing programs already included on base image - Remove `deps.edn` from `.dockerignore` since it is necessary to build * Migrate CircleCI to use a bullseye-based image Also some modifications necessary to make it work: - Migrate from `circleci` images to `clojure` since they're out-of-date and also seem to be considered legacy: https://circleci.com/docs/2.0/circleci-images/#legacy-language-images - Remove unnecessary usage of `sudo`, since all commands runs as root - Sync packages with `Dockerfile`. This will make easier to test locally if everything will work (of course, it is not 100% guarantee) * Remove lsof * Remove "Install {Clojure,Leiningen}" steps Already included on the base image. * Do not change directory when downloading GraalVM * Move "Download GraalVM" to script/download-graalvm * Set GRAALVM_HOME correctly * Unbreak mac build * Revert "Set GRAALVM_HOME correctly" This reverts commit 5e2a6158dc28958bda7c2bd58c5597ebe02d6aef. * Set GRAALVM_HOME correctly, take 2 * Improve download-graalvm script * Re-added "Install Clojure" steps * Set amd64 as default GRAALVM_ARCH * Unbreak linux-aarch64 * Ubreak jvm * Do not change directory * Fix yaml * Fix mac/linux-aarch64 * Add missing Clojure * Fix cache * Move GraalVM installation to /tmp * Use script/install-clojure * Use /opt instead of /tmp to install GraalVM * Revert "Use /opt instead of /tmp to install GraalVM" This reverts commit 3cfad03c8ed641bb915ea19953423c43e801eafc. * Use CircleCI's Clojure images again * Go back to installing GraalVM on $HOME
2021-09-13 21:28:13 +00:00
rm -rf "clojure-tools-$CLOJURE_TOOLS_VERSION.tar.gz"
rm -rf "clojure-tools"
2019-08-09 12:51:42 +00:00
echo "Installed clojure to $install_dir/bin"