1
0
mirror of https://github.com/pdf2htmlEX/pdf2htmlEX.git synced 2024-12-22 13:00:08 +00:00
pdf2htmlEX/buildScripts/uploadDockerImage
2019-11-29 09:43:07 +00:00

49 lines
1.2 KiB
Bash
Executable File

#!/bin/bash
# This bash script uploads the pdf2htmlEX docker image to docker hub
#
# 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)
#
source ./buildScripts/reSourceVersionEnvs
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