Fixed Tagging issues in build_command.sh. Also added lines to catch command failures in Gitlab's CI.

This commit is contained in:
2023-03-21 18:18:29 +08:00
parent 887ec1a4dc
commit d0f22369b7

View File

@@ -1,5 +1,8 @@
#!/usr/bin/env sh
set -x
set -x # For verbosity
set -o errexit # The following two causes the script to fail even if one command fail.
set -o pipefail
export BUILDER_NAME=`docker buildx create --use`
docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
@@ -10,8 +13,8 @@ then
docker buildx build . \
-f Dockerfile \
--build-arg UBUNTU_VER=$UBUNTU_VER \
-t $CI_REGISTRY/docker/$CI_PROJECT_NAME:ubuntu-$UBUNTU_VER:`date "+%Y-%m-%d"` \
-t $CI_REGISTRY/docker/$CI_PROJECT_NAME:ubuntu-$UBUNTU_VER:latest \
-t $CI_REGISTRY/docker/$CI_PROJECT_NAME/ubuntu-$UBUNTU_VER:`date "+%Y-%m-%d"` \
-t $CI_REGISTRY/docker/$CI_PROJECT_NAME/ubuntu-$UBUNTU_VER:latest \
-t $CI_REGISTRY/docker/$CI_PROJECT_NAME:$UBUNTU_VER \
--platform $PLATFORMS \
--push --provenance false