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

71 lines
1.8 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
echo "machine api.github.com" > $HOME/.netrc
echo " login $GITHUB_USERNAME" >> $HOME/.netrc
echo " password $GITHUB_TOKEN" >> $HOME/.netrc
echo "machine uploads.github.com" >> $HOME/.netrc
echo " login $GITHUB_USERNAME" >> $HOME/.netrc
echo " password $GITHUB_TOKEN" >> $HOME/.netrc
2019-11-28 09:07:49 +00:00
echo $BUILD_TIME > buildTime
echo $APPIMAGE_NAME > appImageName
echo $DOCKER_NAME > dockerImageName
2019-11-28 19:13:40 +00:00
echo ../buildScripts/uploadReleaseTool "$TRAVIS_REPO_SLUG" "continuous" "Latest release" \
-- $APPIMAGE_NAME appImageName dockerImageName buildTime
../buildScripts/uploadReleaseTool "$TRAVIS_REPO_SLUG" "continuous" "Latest release" \
-- $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