#!/bin/bash
if [ "$1" == "" ] ; then
    printf "\nNisi zadao verziju Docker image-a koji treba deployati"
    printf "\n\nSintaksa:\n\n    deploy.sh 1.0.0\n\n"
    exit 1
fi

printf "\nBUILD START ...\n\n"

IMAGE_VERSION=$1

echo "Deploying $STACK_NAME with image version: $IMAGE_VERSION"

# Pass IMAGE_VERSION env var for compose variable substitution
IMAGE_VERSION="$IMAGE_VERSION" docker stack deploy \
    -c docker-compose-deploy.yml \
    utility-bills-tracker