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 uses: docker/build-push-action@v5
with: with:
context: . context: .
build-args: | build-args:
VERSION="v${{ steps.get_version.outputs.VERSION }}" VERSION="v${{ steps.get_version.outputs.VERSION }}"
push: true push: true
tags: ${{ steps.meta.outputs.tags }} tags: ${{ steps.meta.outputs.tags }}

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

Loading…
Cancel
Save