Skip to content

Commit

Permalink
[Improve] Build images using flexible version parameters.
Browse files Browse the repository at this point in the history
  • Loading branch information
FlechazoW committed Oct 19, 2023
1 parent 627655d commit 26f44e8
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,22 @@ WORKDIR=$(
pwd
)

DOCKER_VERSION=1.0.0-snapshot
if [ -z "$2" ]; then
VERSION="latest"
else
VERSION=$2
fi

# build code
code() {
/bin/sh $WORKDIR/mvnw clean package -DskipTests -Pci
# mv release zip
mv $WORKDIR/seatunnel-web-dist/target/apache-seatunnel-web-1.0.0-SNAPSHOT.zip $WORKDIR/
mv $WORKDIR/seatunnel-web-dist/target/apache-seatunnel-web-*.zip $WORKDIR/
}

# build image
image() {
docker buildx build --load --no-cache -t apache/seatunnel-web:$DOCKER_VERSION -t apache/seatunnel-web:latest -f $WORKDIR/docker/backend.dockerfile .
docker buildx build --load --no-cache -t apache/seatunnel-web:$VERSION -t apache/seatunnel-web:latest -f $WORKDIR/docker/backend.dockerfile .
}

# main
Expand All @@ -46,7 +50,7 @@ case "$1" in
image
;;
*)
echo "Usage: seatunnel-daemon.sh {start|stop|status}"
echo "Usage: build.sh {code|image}"
exit 1
;;
esac
Expand Down

0 comments on commit 26f44e8

Please sign in to comment.