1
0
mirror of https://github.com/pdf2htmlEX/pdf2htmlEX.git synced 2024-12-22 13:00:08 +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 UNATTENDED="--assume-yes"
export MAKE_PARALLEL="-j $(nproc)" export MAKE_PARALLEL="-j $(nproc)"
export TRAVIS_REPO_SLUG=stephengaito/pdf2htmlEX
# choose one of the following... # choose one of the following...
# #

View File

@ -16,54 +16,84 @@ source ./buildScripts/reSourceVersionEnvs
# upload github release artefacts # upload github release artefacts
# #
# begin by gathering the required environment variables
#
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 cd imageBuild
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
echo "machine api.github.com" > $HOME/.netrc echo $BUILD_TIME > buildTime
echo " login $GITHUB_USERNAME" >> $HOME/.netrc echo $APPIMAGE_NAME > appImageName
echo " password $GITHUB_TOKEN" >> $HOME/.netrc echo $DOCKER_NAME > dockerImageName
echo "machine uploads.github.com" >> $HOME/.netrc
echo " login $GITHUB_USERNAME" >> $HOME/.netrc
echo " password $GITHUB_TOKEN" >> $HOME/.netrc
echo $BUILD_TIME > buildTime echo ../buildScripts/uploadReleaseTool "$TRAVIS_REPO_SLUG" "continuous" "Latest release" \
-- $APPIMAGE_NAME appImageName dockerImageName buildTime
echo $APPIMAGE_NAME > appImageName ../buildScripts/uploadReleaseTool "$TRAVIS_REPO_SLUG" "continuous" "Latest release" \
-- $APPIMAGE_NAME appImageName dockerImageName buildTime
echo $DOCKER_NAME > dockerImageName
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
else
echo "GITHUB_TOKEN not set... so we can not upload release artefacts."
fi
################################## ##################################
# push docker image # push docker image
# #
if [ -x "$(which docker)" ]; then if [ -x "$(which docker)" ]; then
if [ -n "$DOCKER_USERNAME" ]; then if [ -z "$DOCKER_USERNAME" ]; then
echo ""
if [ -z "$DOCKER_PASSWORD" ]; then read -p "Enter the Docker usernane): " DOCKER_USERNAME
echo "" echo ""
echo "Please type your the Docker hub password" if [ -z "$DOCKER_USERNAME" ]; then
docker login -u "$DOCKER_USERNAME" echo "DOCKER_USERNAME not set... so we do not know where to push image."
else exit 1
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
fi fi
docker push $DOCKER_USERNAME/pdf2htmlex
else
echo "DOCKER_USERNAME not set... so we do not know where to push image."
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 else
echo "Docker is not installed... skipping upload of docker image." echo "Docker is not installed... skipping upload of docker image."
fi 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_FROM=\"$DOCKER_FROM\"" >> buildScripts/reSourceVersionEnvs
echo "export DOCKER_NAME=\"$DOCKER_NAME\"" >> buildScripts/reSourceVersionEnvs echo "export DOCKER_NAME=\"$DOCKER_NAME\"" >> buildScripts/reSourceVersionEnvs
echo "export APPIMAGE_NAME=\"$APPIMAGE_NAME\"" >> buildScripts/reSourceVersionEnvs echo "export APPIMAGE_NAME=\"$APPIMAGE_NAME\"" >> buildScripts/reSourceVersionEnvs
echo "export TRAVIS_REPO_SLUG=\"$TRAVIS_REPO_SLUG\"" >> buildScripts/reSourceVersionEnvs