1
0
mirror of https://github.com/pdf2htmlEX/pdf2htmlEX.git synced 2024-12-22 04:50:09 +00:00

refactored upload process

This commit is contained in:
Stephen Gaito 2019-11-29 07:28:23 +00:00
parent cd88751cf3
commit 41e8218f65
4 changed files with 104 additions and 35 deletions

View File

@ -0,0 +1,41 @@
#!/bin/bash
# This bash script builds the complete pdf2htmlEX application LOCALLY
# (It does not create the AppImage or Docker images)
# Adjust the following two environment variables to suit your needs
#
export UNATTENDED="--assume-yes"
export MAKE_PARALLEL="-j $(nproc)"
# choose one of the following...
#
export PDF2HTMLEX_BRANCH=newBuildSystem
# export PDF2HTMLEX_BRANCH="$(git rev-parse --abbrev-ref HEAD)"
################
# do the build
./buildScripts/versionEnvs || { echo 'versionEnvs FAILED' ; exit 1 ; }
./buildScripts/reportEnvs || { echo 'reportEnvs FAILED' ; exit 1 ; }
./buildScripts/getBuildTools || { echo 'getBuildTools FAILED' ; exit 1 ; }
./buildScripts/getDevLibraries || { echo 'getDevLibraries FAILED' ; exit 1 ; }
./buildScripts/getPoppler || { echo 'getPoppler FAILED' ; exit 1 ; }
./buildScripts/buildPoppler || { echo 'buildPoppler FAILED' ; exit 1 ; }
./buildScripts/installPoppler || { echo 'installPoppler FAILED' ; exit 1 ; }
./buildScripts/getFontforge || { echo 'getFontforge FAILED' ; exit 1 ; }
./buildScripts/buildFontforge || { echo 'buildFontforge FAILED' ; exit 1 ; }
./buildScripts/installFontforge || { echo 'installFontforge FAILED' ; exit 1 ; }
./buildScripts/buildPdf2htmlEX || { echo 'buildPdf2htmlEX FAILED' ; exit 1 ; }
./buildScripts/installPdf2htmlEX || { echo 'installPdf2htmlEX FAILED' ; exit 1 ; }

View File

@ -7,7 +7,6 @@
#
export UNATTENDED="--assume-yes"
export MAKE_PARALLEL="-j $(nproc)"
export TRAVIS_REPO_SLUG=stephengaito/pdf2htmlEX
# choose one of the following...
#

View File

@ -16,9 +16,40 @@ source ./buildScripts/reSourceVersionEnvs
# upload github release artefacts
#
cd imageBuild
# begin by gathering the required environment variables
#
if [ -n "$GITHUB_TOKEN" ]; then
if [ -z "$GITHUB_USERNAME" ]; then
echo ""
read -p "Enter the GitHub upload username: " GITHUB_USERNAME
echo ""
if [ -z "$GITHUB_USERNAME" ]; then
echo "GITHUB_USERNAME not set... so we can not upload release artefacts."
exit 1
fi
fi
if [ -z "$GITHUB_TOKEN" ]; then
echo ""
read -p "Enter the GitHub upload token/password: " GITHUB_TOKEN
echo ""
if [ -z "$GITHUB_TOKEN" ]; then
echo "GITHUB_TOKEN not set... so we can not upload release artefacts."
exit 1
fi
fi
if [ -z "$TRAVIS_REPO_SLUG" ]; then
echo ""
read -p "Enter the GitHub repository (user/proj): " TRAVIS_REPO_SLUG
echo ""
if [ -z "$TRAVIS_REPO_SLUG" ]; then
echo "TRAVIS_REPO_SLUG (Github repository) not set... so we can not upload release artefacts."
exit 1
fi
fi
cd imageBuild
echo "machine api.github.com" > $HOME/.netrc
echo " login $GITHUB_USERNAME" >> $HOME/.netrc
@ -28,9 +59,7 @@ if [ -n "$GITHUB_TOKEN" ]; then
echo " password $GITHUB_TOKEN" >> $HOME/.netrc
echo $BUILD_TIME > buildTime
echo $APPIMAGE_NAME > appImageName
echo $DOCKER_NAME > dockerImageName
echo ../buildScripts/uploadReleaseTool "$TRAVIS_REPO_SLUG" "continuous" "Latest release" \
@ -39,16 +68,21 @@ if [ -n "$GITHUB_TOKEN" ]; then
../buildScripts/uploadReleaseTool "$TRAVIS_REPO_SLUG" "continuous" "Latest release" \
-- $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_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 ""
@ -60,10 +94,6 @@ if [ -x "$(which docker)" ]; then
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

View File

@ -31,5 +31,4 @@ echo "export BUILD_TIME=\"$BUILD_TIME\"" >> buildScripts/reSourceV
echo "export DOCKER_FROM=\"$DOCKER_FROM\"" >> buildScripts/reSourceVersionEnvs
echo "export DOCKER_NAME=\"$DOCKER_NAME\"" >> buildScripts/reSourceVersionEnvs
echo "export APPIMAGE_NAME=\"$APPIMAGE_NAME\"" >> buildScripts/reSourceVersionEnvs
echo "export TRAVIS_REPO_SLUG=\"$TRAVIS_REPO_SLUG\"" >> buildScripts/reSourceVersionEnvs