Add return value check for tagging

Signed-off-by: Qi Zheng <qi.zheng@intel.com>
This commit is contained in:
Qi Zheng
2019-11-14 14:34:40 +08:00
committed by qzheng527
parent 7e62245281
commit 4d313de742
2 changed files with 3 additions and 7 deletions
+1 -2
View File
@@ -13,9 +13,8 @@ function get_tag {
# no matches, return NULL tag
if [ -z "$matches" ]; then
echo ""
echo "no $pkg found on the release $clr_ver"
exit 0
exit 1
fi
matches=($matches)
+2 -5
View File
@@ -1,16 +1,13 @@
#!/bin/bash
echo "=> Tagging the image"
set -e
. ../docker-hooks.sh
image="clearlinux/redis"
tag=$(get_tag redis-native)
if [ -z "$tag" ]; then
echo "no $pkg found on the release $clr_ver"
else
if [ $? -eq 0 ] && [ -n "$tag" ]; then
set -e
docker tag $image:latest $image:$tag
docker push $image:$tag
major_tag=${tag%%.*}