#!/usr/bin/env bash set -euo pipefail # Validate input parameters if [ "$#" -ne 1 ]; then echo "Usage: $0 " exit 1 fi VERSION="$1" IMAGE_NAME="tsysdevstack-toolboxstack-toolbox-qadocker" # Build the image with the version tag echo "Building ${IMAGE_NAME}:${VERSION}" if ! docker build --tag "${IMAGE_NAME}:${VERSION}" .; then echo "Error: Failed to build ${IMAGE_NAME}:${VERSION}" >&2 exit 1 fi # Run tests echo "Running tests..." if ! ./test.sh; then echo "Error: Tests failed for ${IMAGE_NAME}:${VERSION}" >&2 exit 1 fi # Create release tag echo "Creating release tag..." if ! docker tag "${IMAGE_NAME}:${VERSION}" "${IMAGE_NAME}:release-current"; then echo "Error: Failed to create release tag for ${IMAGE_NAME}" >&2 exit 1 fi echo "Release ${IMAGE_NAME}:${VERSION} completed successfully!"