diff --git a/build/install/docker/hooks/push b/build/install/docker/hooks/push index 8691ce2aca6..8e1d23b25ce 100644 --- a/build/install/docker/hooks/push +++ b/build/install/docker/hooks/push @@ -1,3 +1,18 @@ #!/bin/bash export DOCKER_TAG=$DOCKER_TAG +BASE_NAME="appserver" +BUILD_NUMBER="$(date "+%Y%m%d%H")" +docker-compose -f build.yml push + +# Get docker images name to array +arrayImagesName=($(docker image ls | grep "$DOCKER_TAG" | grep "$STATUS" | grep "$BASE_NAME" | awk '{print $1}' )) + +# Modify docker image tag +for i in ${!arrayImagesName[@]}; do + echo " Modify ${arrayImagesName[$i]}:$DOCKER_TAG " + docker image tag ${arrayImagesName[$i]}:$DOCKER_TAG ${arrayImagesName[$i]}:$DOCKER_TAG-$BUILD_NUMBER +done + +# Push the same images with a new tag +DOCKER_TAG=$DOCKER_TAG-$BUILD_NUMBER docker-compose -f build.yml push