#!/bin/bash set -e tagStart=$(echo $IMAGE_NAME | awk '{print index($1,":")}') repoName=${IMAGE_NAME:0:tagStart-1} tagName=${IMAGE_NAME:tagStart:99} if [ "$tagName" = "latest-apache" ]; then echo "Tagging $IMAGE_NAME as :latest" docker tag $IMAGE_NAME ${repoName}:latest docker push ${repoName}:latest fi