You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tika.apache.org by dm...@apache.org on 2020/02/06 04:28:58 UTC
[tika-docker] branch master updated: Updated docker-tool with
improved test and publish command
This is an automated email from the ASF dual-hosted git repository.
dmeikle pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tika-docker.git
The following commit(s) were added to refs/heads/master by this push:
new f0d76ac Updated docker-tool with improved test and publish command
f0d76ac is described below
commit f0d76ac92b4c7e2ea92f5c25a9709b13ec8e575c
Author: David Meikle <dm...@apache.org>
AuthorDate: Thu Feb 6 04:28:42 2020 +0000
Updated docker-tool with improved test and publish command
---
docker-tool.sh | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/docker-tool.sh b/docker-tool.sh
index 9386b83..c414d25 100755
--- a/docker-tool.sh
+++ b/docker-tool.sh
@@ -34,15 +34,20 @@ while getopts ":h" opt; do
esac
done
+
test_docker_image() {
docker run -d --name "$1" -p 9998:9998 apache/tika:"$1"
sleep 10
- curl http://localhost:9998/version
- if [ $? -eq 0 ]
+ url=http://localhost:9998/version
+ status=$(curl --head --location --connect-timeout 5 --write-out %{http_code} --silent --output /dev/null ${url})
+
+ if [[ $status == '200' ]]
then
+ echo "$(tput setaf 2)Image: apache/tika:${1} - Passed$(tput sgr0)"
docker kill "$1"
docker rm "$1"
else
+ echo "$(tput setaf 1)Image: apache/tika:${1} - Failed$(tput sgr0)"
docker kill "$1"
docker rm "$1"
exit 1