diff --git a/hooks/post_push b/hooks/post_push index c415956..6918a63 100755 --- a/hooks/post_push +++ b/hooks/post_push @@ -1,8 +1,19 @@ #!/bin/bash set -e + +echo "Working dir and contents I see are:" echo `pwd` -VERSION=`grep -e "\d\.\d\.\d" -o Dockerfile` +echo `ls` + +## Not all bash commands are available. notably grep -o -e options fail!! +VERSION=`cat Dockerfile | head -n1 | sed 's/.*\([0-9].[0-9].[0-9]\)/\1/'` +echo "Version being built is:" +echo $VERSION + +echo "tagging $IMAGE_NAME as $DOCKER_REPO:$VERSION..." docker tag $IMAGE_NAME $DOCKER_REPO:$VERSION + +echo "pushing $DOCKER_REPO:$VERSION to hub..." docker push $DOCKER_REPO:$VERSION diff --git a/shiny-verse/hooks/post_push b/shiny-verse/hooks/post_push index c415956..6918a63 100755 --- a/shiny-verse/hooks/post_push +++ b/shiny-verse/hooks/post_push @@ -1,8 +1,19 @@ #!/bin/bash set -e + +echo "Working dir and contents I see are:" echo `pwd` -VERSION=`grep -e "\d\.\d\.\d" -o Dockerfile` +echo `ls` + +## Not all bash commands are available. notably grep -o -e options fail!! +VERSION=`cat Dockerfile | head -n1 | sed 's/.*\([0-9].[0-9].[0-9]\)/\1/'` +echo "Version being built is:" +echo $VERSION + +echo "tagging $IMAGE_NAME as $DOCKER_REPO:$VERSION..." docker tag $IMAGE_NAME $DOCKER_REPO:$VERSION + +echo "pushing $DOCKER_REPO:$VERSION to hub..." docker push $DOCKER_REPO:$VERSION