2020-06-20 09:11:30 +00:00
|
|
|
#!/bin/sh
|
2019-11-29 09:43:07 +00:00
|
|
|
|
2020-06-20 09:11:30 +00:00
|
|
|
# This shell script uploads the pdf2htmlEX docker image to docker hub
|
2019-11-29 09:43:07 +00:00
|
|
|
#
|
|
|
|
# We EXPECT the following environment variables to be set:
|
|
|
|
# DOCKER_USERNAME
|
|
|
|
#
|
|
|
|
# You can OPTIONALLY set the following environment variables:
|
|
|
|
# DOCKER_PASSWORD (if not set you will be asked for your password)
|
|
|
|
#
|
|
|
|
|
2020-06-20 09:11:30 +00:00
|
|
|
# source ./buildScripts/reSourceVersionEnvs
|
|
|
|
. ./buildScripts/reSourceVersionEnvs
|
2019-11-29 09:43:07 +00:00
|
|
|
|
|
|
|
echo ""
|
|
|
|
echo "-------------------------------------------------------------------"
|
|
|
|
echo "UPLOADING pdf2htmlEX Docker Image to Docker Hub"
|
|
|
|
echo "-------------------------------------------------------------------"
|
|
|
|
echo ""
|
|
|
|
|
|
|
|
##################################
|
|
|
|
# push docker image
|
|
|
|
#
|
|
|
|
if [ -x "$(which docker)" ]; then
|
|
|
|
|
|
|
|
if [ -z "$DOCKER_USERNAME" ]; then
|
|
|
|
echo ""
|
|
|
|
read -p "Enter the Docker usernane): " DOCKER_USERNAME
|
|
|
|
echo ""
|
|
|
|
if [ -z "$DOCKER_USERNAME" ]; then
|
|
|
|
echo "DOCKER_USERNAME not set... so we do not know where to push image."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -z "$DOCKER_PASSWORD" ]; then
|
|
|
|
echo ""
|
|
|
|
echo "Please type your the Docker hub password"
|
|
|
|
docker login -u "$DOCKER_USERNAME"
|
|
|
|
else
|
|
|
|
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
|
|
|
|
fi
|
|
|
|
|
|
|
|
docker push $DOCKER_USERNAME/pdf2htmlex
|
|
|
|
|
|
|
|
else
|
|
|
|
echo "Docker is not installed... skipping upload of docker image."
|
|
|
|
fi
|
|
|
|
|