From 21f1e598e2e9091cd97bb02b344c075838145b6e Mon Sep 17 00:00:00 2001 From: casjay Date: Wed, 12 Oct 2022 18:42:53 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=97=83=EF=B8=8F=20Committing=20everything?= =?UTF-8?q?=20that=20changed=20=F0=9F=97=83=EF=B8=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 8 +++++--- bin/get-deno.sh | 15 +++++++++------ 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/Dockerfile b/Dockerfile index 07319a0..fb4b0ed 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,6 +5,8 @@ ARG alpine_version="v3.16" \ TIMEZONE="America/New_York" \ IMAGE_NAME="alpine" \ LICENSE="MIT" \ + DEBUG="" \ + DENO_VERSION="v1.26.1" \ PORTS="1-65535" ENV TZ="$TIMEZONE" \ @@ -12,7 +14,8 @@ ENV TZ="$TIMEZONE" \ ENV="$HOME/.bashrc" \ TERM="xterm-256color" \ HOSTNAME="${HOSTNAME:-casjaysdev-$IMAGE_NAME}" \ - DENO_VERSION="v1.26.1" + DEBUG="${DEBUG}" \ + DENO_VERSION="${DENO_VERSION}" RUN set -ex; \ rm -Rf "/etc/apk/repositories"; \ @@ -27,7 +30,7 @@ COPY ./data/. /usr/local/share/template-files/data/ COPY ./config/. /usr/local/share/template-files/config/ RUN chmod -Rf 755 /usr/local/bin/get-deno.sh && \ - DEBUG="true" /usr/local/bin/get-deno.sh && \ + /usr/local/bin/get-deno.sh && \ rm -Rf /usr/local/bin/get-deno.sh /bin/.gitkeep /config /data /var/cache/apk/* FROM scratch @@ -67,4 +70,3 @@ EXPOSE $PORTS ENTRYPOINT [ "tini", "-p", "SIGTERM", "--" ] CMD [ "/usr/local/bin/entrypoint-deno.sh" ] HEALTHCHECK --start-period=1m --interval=2m --timeout=3s CMD [ "/usr/local/bin/entrypoint-deno.sh", "healthcheck" ] - diff --git a/bin/get-deno.sh b/bin/get-deno.sh index 84cfec6..a54ad23 100755 --- a/bin/get-deno.sh +++ b/bin/get-deno.sh @@ -24,15 +24,16 @@ DENO_URL_ARM64_LATEST="https://github.com/LukeChannings/deno-arm64/releases/late DENO_URL_ARM64_VERSION="https://github.com/LukeChannings/deno-arm64/releases/download/$DENO_VERSION/deno-linux-arm64.zip" # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - __get_file() { - if curl -q -LSsf -o "$FILE" "$URL" || false; then - return 0 - elif curl -q -LSsf -o "$FILE" "$LATEST_URL" || false; then + local exitStatus="" + if curl -q -LSf -o "$FILE" "$URL"; then + exitStatus=0 + elif curl -q -LSf -o "$FILE" "$LATEST_URL"; then URL="$LATEST_URL" - return 0 + exitStatus=0 else - - return 1 + exitStatus=1 fi + return ${exitStatus} } # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # AMD64 binary @@ -40,6 +41,7 @@ if [ "$(uname -m)" = "amd64" ] || [ "$(uname -m)" = "x86_64" ]; then ARCH=x86_64 FILE="/tmp/deno-$ARCH.zip" URL="$DENO_URL_x64_VERSION" + LATEST_URL="$DENO_URL_x64_LATEST" if [ "$DENO_VERSION" = "latest" ] || [ -z "$DENO_VERSION" ]; then DENO_VERSION="latest" URL="$DENO_URL_x64_LATEST" @@ -62,6 +64,7 @@ if [ "$(uname -m)" = "arm64" ] || [ "$(uname -m)" = "aarch64" ]; then ARCH=arm64 FILE="/tmp/deno-$ARCH.zip" URL="$DENO_URL_ARM64_VERSION" + LATEST_URL="$DENO_URL_ARM64_LATEST" if [ "$DENO_VERSION" = "latest" ] || [ -z "$DENO_VERSION" ]; then DENO_VERSION="latest" URL="$DENO_URL_ARM64_LATEST"