From 2b64afcf4735010bc84a3ac6c1d5516472648896 Mon Sep 17 00:00:00 2001 From: Ivan Dyachkov Date: Tue, 2 Jan 2024 11:17:57 +0100 Subject: [PATCH] feat: add update.sh --- update.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100755 update.sh diff --git a/update.sh b/update.sh new file mode 100755 index 0000000..bf27281 --- /dev/null +++ b/update.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env bash + +set -eou pipefail + +VERSION="$1" +VERSION_DIR=$(echo "$VERSION" | cut -d '.' -f 1,2 -) + +AMD64_SHA256=$(curl -sSL https://github.com/emqx/emqx/releases/download/v${VERSION}/emqx-${VERSION}-debian11-amd64.tar.gz.sha256) +ARM64_SHA256=$(curl -sSL https://github.com/emqx/emqx/releases/download/v${VERSION}/emqx-${VERSION}-debian11-arm64.tar.gz.sha256) + +sed -i'' -e "s/EMQX_VERSION=.*/EMQX_VERSION=${VERSION}/" $VERSION_DIR/Dockerfile +sed -i'' -e "s/AMD64_SHA256=.*/AMD64_SHA256=${AMD64_SHA256}/" $VERSION_DIR/Dockerfile +sed -i'' -e "s/ARM64_SHA256=.*/ARM64_SHA256=${ARM64_SHA256}/" $VERSION_DIR/Dockerfile