Fix: docker build args

pull/21/head v0.2.2
zijiren233 2 years ago
parent 36fc3ecec9
commit 3849bd68e8

@ -40,7 +40,7 @@ jobs:
uses: docker/build-push-action@v5
with:
context: .
build-args: |
build-args:
VERSION="v${{ steps.get_version.outputs.VERSION }}"
push: true
tags: ${{ steps.meta.outputs.tags }}

@ -47,7 +47,7 @@ function ParseArgs() {
exit 0
;;
v)
VERSION="$OPTARG"
VERSION="$(echo "$OPTARG" | sed 's/ //g')"
;;
w)
WEB_VERSION="$OPTARG"
@ -99,22 +99,17 @@ function GetLatestWebVersion() {
# Comply with golang version rules
function CheckVersionFormat() {
if [ "$1" == "dev" ]; then
return 0
fi
if [ "$(echo "$1" | grep -oE "^v?[0-9]+\.[0-9]+\.[0-9]+$")" ]; then
if [ "$1" == "dev" ] || [ "$(echo "$1" | grep -oE "^v?[0-9]+\.[0-9]+\.[0-9]+$")" ]; then
return 0
else
echo "version format error: $1"
exit 1
fi
return 1
}
function FixArgs() {
CheckAllPlatform
CheckVersionFormat "$VERSION"
if [ $? -ne 0 ]; then
echo "version format error"
exit 1
fi
if [ ! "$WEB_VERSION" ]; then
if [ "$VERSION" == "dev" ]; then
WEB_VERSION="dev"

Loading…
Cancel
Save