mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-18 00:34:28 +08:00
add release type in log
This commit is contained in:
@@ -1,7 +1,8 @@
|
|||||||
#!/usr/bin/env sh
|
#!/usr/bin/env sh
|
||||||
|
|
||||||
TYPE=""
|
TYPE=""
|
||||||
RELEASE=${RELEASE_BUILD:-"0"};
|
RELEASE=${RELEASE_BUILD:-"0"}
|
||||||
|
RELEASE_TYPE="unknown"
|
||||||
VERSION=""
|
VERSION=""
|
||||||
COMMIT_HASH=""
|
COMMIT_HASH=""
|
||||||
BUILD_UNIXTIME=""
|
BUILD_UNIXTIME=""
|
||||||
@@ -68,6 +69,12 @@ parse_args() {
|
|||||||
|
|
||||||
shift 1
|
shift 1
|
||||||
done
|
done
|
||||||
|
|
||||||
|
if [ "$RELEASE" = "0" ]; then
|
||||||
|
RELEASE_TYPE="snapshot"
|
||||||
|
else
|
||||||
|
RELEASE_TYPE="release"
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
check_type_dependencies() {
|
check_type_dependencies() {
|
||||||
@@ -102,7 +109,7 @@ build_backend() {
|
|||||||
backend_extra_arguments="$backend_extra_arguments -X github.com/mayswind/ezbookkeeping/pkg/version.BuildUnixTime=$BUILD_UNIXTIME"
|
backend_extra_arguments="$backend_extra_arguments -X github.com/mayswind/ezbookkeeping/pkg/version.BuildUnixTime=$BUILD_UNIXTIME"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Building backend binary file..."
|
echo "Building backend binary file ($RELEASE_TYPE)..."
|
||||||
|
|
||||||
CGO_ENABLED=1 go build -a -v -trimpath -ldflags "-w -s -linkmode external -extldflags '-static' $backend_extra_arguments" -o ezbookkeeping ezbookkeeping.go
|
CGO_ENABLED=1 go build -a -v -trimpath -ldflags "-w -s -linkmode external -extldflags '-static' $backend_extra_arguments" -o ezbookkeeping ezbookkeeping.go
|
||||||
chmod +x ezbookkeeping
|
chmod +x ezbookkeeping
|
||||||
@@ -118,7 +125,7 @@ build_frontend() {
|
|||||||
echo "Pulling frontend dependencies..."
|
echo "Pulling frontend dependencies..."
|
||||||
npm install
|
npm install
|
||||||
|
|
||||||
echo "Building frontend files..."
|
echo "Building frontend files ($RELEASE_TYPE)..."
|
||||||
npm run build "$frontend_build_arguments"
|
npm run build "$frontend_build_arguments"
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -135,7 +142,7 @@ build_docker() {
|
|||||||
docker_tag="$DOCKER_TAG"
|
docker_tag="$DOCKER_TAG"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Building docker image \"$docker_tag\"..."
|
echo "Building docker image \"$docker_tag\" ($RELEASE_TYPE)..."
|
||||||
|
|
||||||
docker build . -t "$docker_tag" --build-arg RELEASE_BUILD=$RELEASE
|
docker build . -t "$docker_tag" --build-arg RELEASE_BUILD=$RELEASE
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user