🗃️ Committing everything that changed 🗃️

This commit is contained in:
casjay 2022-10-12 20:07:21 -04:00
parent 594fddf413
commit 9f1cb99205
No known key found for this signature in database
GPG Key ID: 4F765975C1F0EE5F
2 changed files with 10 additions and 11 deletions

View File

@ -14,8 +14,8 @@ ENV TZ="$TIMEZONE" \
ENV="$HOME/.bashrc" \ ENV="$HOME/.bashrc" \
TERM="xterm-256color" \ TERM="xterm-256color" \
HOSTNAME="${HOSTNAME:-casjaysdev-$IMAGE_NAME}" \ HOSTNAME="${HOSTNAME:-casjaysdev-$IMAGE_NAME}" \
DEBUG="${DEBUG}" \ DEBUG="$DEBUG" \
DENO_VERSION="${DENO_VERSION}" DENO_VERSION="$DENO_VERSION"
RUN set -ex; \ RUN set -ex; \
rm -Rf "/etc/apk/repositories"; \ rm -Rf "/etc/apk/repositories"; \
@ -31,7 +31,7 @@ COPY ./config/. /usr/local/share/template-files/config/
RUN chmod -Rf 755 /usr/local/bin/get-deno.sh && \ RUN chmod -Rf 755 /usr/local/bin/get-deno.sh && \
/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/* rm -Rf /usr/local/bin/get-deno.sh /tmp/* /bin/.gitkeep /config /data /var/cache/apk/*
FROM scratch FROM scratch

View File

@ -21,36 +21,35 @@ DENO_VERSION="${DENO_VERSION:-v1.26.1}"
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
if [ "$(uname -m)" = "amd64" ] || [ "$(uname -m)" = "x86_64" ]; then if [ "$(uname -m)" = "amd64" ] || [ "$(uname -m)" = "x86_64" ]; then
ARCH="x86_64" ARCH="x86_64"
CHANNEL="denoland"
URL="https://github.com/denoland/deno/releases/download/$DENO_VERSION/deno-$ARCH-unknown-linux-gnu.zip" URL="https://github.com/denoland/deno/releases/download/$DENO_VERSION/deno-$ARCH-unknown-linux-gnu.zip"
BIN_FILE="/usr/bin/deno" BIN_FILE="/usr/bin/deno"
TMP_DIR="/tmp/deno-$ARCH" TMP_DIR="/tmp/deno-$ARCH"
TMP_FILE="/tmp/deno-$ARCH.zip" TMP_FILE="/tmp/deno-$ARCH.zip"
message="grabbing $DENO_VERSION from denoland for $ARCH"
err_mess="Failed to download deno from $URL"
elif [ "$(uname -m)" = "arm64" ] || [ "$(uname -m)" = "aarch64" ]; then elif [ "$(uname -m)" = "arm64" ] || [ "$(uname -m)" = "aarch64" ]; then
ARCH="arm64" ARCH="arm64"
CHANNEL="LukeChannings"
URL="https://github.com/LukeChannings/deno-arm64/releases/download/$DENO_VERSION/deno-linux-$ARCH.zip" URL="https://github.com/LukeChannings/deno-arm64/releases/download/$DENO_VERSION/deno-linux-$ARCH.zip"
BIN_FILE="/usr/bin/deno" BIN_FILE="/usr/bin/deno"
TMP_DIR="/tmp/deno-$ARCH" TMP_DIR="/tmp/deno-$ARCH"
TMP_FILE="/tmp/deno-$ARCH.zip" TMP_FILE="/tmp/deno-$ARCH.zip"
message="grabbing $DENO_VERSION from LukeChannings for $ARCH"
err_mess="Failed to download deno from $URL"
else else
echo "Unsupported architecture" echo "Unsupported architecture"
exit 1 exit 1
fi fi
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
echo "$message" echo "grabbing deno $DENO_VERSION from $CHANNEL for $ARCH"
if curl -q -LSsf -o "$TMP_FILE" "$URL" && [ -f "$TMP_FILE" ]; then if curl -q -LSsf -o "$TMP_FILE" "$URL" && [ -f "$TMP_FILE" ]; then
mkdir -p "$TMP_DIR" && cd "$TMP_DIR" || exit 10 mkdir -p "$TMP_DIR" && cd "$TMP_DIR" || exit 10
unzip "$TMP_FILE" unzip "$TMP_FILE"
mv -fv "$TMP_DIR/deno" "$BIN_FILE" mv -fv "$TMP_DIR/deno" "$BIN_FILE"
chmod -Rf 755 "$BIN_FILE" chmod -Rf 755 "$BIN_FILE"
else else
echo "$err_mess" echo "Failed to download deno from $URL"
exit 2 exitCode=2
fi fi
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
rm -Rf "$TMP_FILE" "$TMP_DIR" rm -Rf "$TMP_FILE" "$TMP_DIR"
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
[ -f "$(which "deno" 2>/dev/null)" ] && deno upgrade && exit 0 || exit 10 [ -f "$BIN_FILE" ] && $BIN_FILE upgrade && exit 0 || exit 10
exit ${exitCode:-0}