Created
October 27, 2017 07:04
-
-
Save aditya-konarde/539cab2774988a5cbf3fe14c3e53b55c to your computer and use it in GitHub Desktop.
Check images
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Show command before executing | |
set -x | |
# Exit on error | |
set -e | |
# Check the existence of image on registry.centos.org | |
IMAGE="mattermost-team" | |
REGISTRY="https://registry.centos.org" | |
REPOSITORY="mattermost" | |
TAG="4.3" | |
curl -X GET $REGISTRY/v2/$REPOSITORY/$IMAGE/tags/list | grep -w $TAG | |
if [ $? -eq 0 ]; then | |
echo 'CICO: Image existence check successful. Ready to deploy updated app' | |
exit 0 | |
else | |
echo 'CICO: Image push to registry failed' | |
exit 2 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment