1
0
mirror of https://github.com/pdf2htmlEX/pdf2htmlEX.git synced 2024-12-22 13:00:08 +00:00
pdf2htmlEX/buildScripts/uploadRelease

77 lines
1.9 KiB
Plaintext
Raw Normal View History

2019-11-28 09:07:49 +00:00
#!/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)
#
2019-11-28 12:04:22 +00:00
source ./buildScripts/reSourceVersionEnvs
2019-11-28 09:07:49 +00:00
##################################
# upload github release artefacts
#
2019-11-28 12:04:22 +00:00
cd imageBuild
2019-11-28 09:07:49 +00:00
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
2019-11-28 13:04:03 +00:00
export UPLOADTOOL_BODY=<<RELEASE_MESSAGE
2019-11-28 09:07:49 +00:00
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
2019-11-28 13:49:35 +00:00
echo ""
echo "---------------------------------------------------------------"
echo "upload tool body:
echo "---------------------------------------------------------------"
echo $UPLOADTOOL_BODY
echo "---------------------------------------------------------------"
echo ""
2019-11-28 13:04:03 +00:00
bash upload.sh $APPIMAGE_NAME appImageName dockerImageName buildTime
2019-11-28 09:07:49 +00:00
else
2019-11-28 12:04:22 +00:00
echo "GITHUB_TOKEN not set... so we can not upload release artefacts."
2019-11-28 09:07:49 +00:00
fi
##################################
# push docker image
#
if [ -x "$(which docker)" ]; then
if [ -n "$DOCKER_USERNAME" ]; then
if [ -z "$DOCKER_PASSWORD" ]; then
2019-11-28 13:04:03 +00:00
echo ""
echo "Please type your the Docker hub password"
2019-11-28 09:07:49 +00:00
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