22 lines
616 B
Bash
22 lines
616 B
Bash
#!/bin/bash
|
|
|
|
# Exit immediately if any command exits with a non-zero status
|
|
set -e
|
|
|
|
name="photogallery"
|
|
version="1.0-0"
|
|
registry="registry.unblue.uk"
|
|
image_name="${registry}/${name}"
|
|
|
|
echo "🔨 Building Docker image for ${name}..."
|
|
# Build the image using the local Dockerfile context
|
|
docker build -t "${image_name}:${version}" -t "${image_name}:latest" .
|
|
|
|
echo "🚀 Pushing tags to ${registry}..."
|
|
# Push the specific release version tag
|
|
docker push "${image_name}:${version}"
|
|
|
|
# Push the latest tag
|
|
docker push "${image_name}:latest"
|
|
|
|
echo "✅ Successfully built and pushed ${image_name}:${version} and :latest" |