mirror of
https://github.com/pdf2htmlEX/pdf2htmlEX.git
synced 2024-12-22 13:00:08 +00:00
77 lines
1.9 KiB
Bash
Executable File
77 lines
1.9 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
# This bash script uploads the pdf2htmlEX release artefacts
|
|
#
|
|
# We EXPECT the following environment variables to be set:
|
|
# GITHUB_TOKEN
|
|
# 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
|
|
|
|
##################################
|
|
# upload github release artefacts
|
|
#
|
|
|
|
cd imageBuild
|
|
|
|
if [ -n "$GITHUB_TOKEN" ]; then
|
|
wget -c https://github.com/probonopd/uploadtool/raw/master/upload.sh
|
|
|
|
echo $BUILD_TIME > buildTime
|
|
|
|
echo $APPIMAGE_NAME > appImageName
|
|
|
|
echo $DOCKER_NAME > dockerImageName
|
|
|
|
export UPLOADTOOL_BODY=<<RELEASE_MESSAGE
|
|
This is the development/testing release of the pdf2htmlEX AppImage.
|
|
|
|
You can download the AppImage and 'just run it'.
|
|
|
|
See: https://appimage.org/ for details
|
|
RELEASE_MESSAGE
|
|
|
|
echo ""
|
|
echo "---------------------------------------------------------------"
|
|
echo "upload tool body:
|
|
echo "---------------------------------------------------------------"
|
|
echo $UPLOADTOOL_BODY
|
|
echo "---------------------------------------------------------------"
|
|
echo ""
|
|
|
|
bash upload.sh $APPIMAGE_NAME appImageName dockerImageName buildTime
|
|
|
|
else
|
|
echo "GITHUB_TOKEN not set... so we can not upload release artefacts."
|
|
fi
|
|
|
|
##################################
|
|
# push docker image
|
|
#
|
|
if [ -x "$(which docker)" ]; then
|
|
|
|
if [ -n "$DOCKER_USERNAME" ]; then
|
|
|
|
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_USERNAME not set... so we do not know where to push image."
|
|
fi
|
|
|
|
else
|
|
echo "Docker is not installed... skipping upload of docker image."
|
|
fi
|
|
|