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