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

refactored upload scripts

This commit is contained in:
Stephen Gaito 2019-11-29 09:43:07 +00:00
parent b207b8ea48
commit c50bc7ecfa
8 changed files with 100 additions and 10 deletions

View File

@ -13,6 +13,9 @@ echo ""
# For appimage output plugin # For appimage output plugin
# #
export VERSION="$PDF2HTMLEX_BRANCH-$BUILD_TIME" export VERSION="$PDF2HTMLEX_BRANCH-$BUILD_TIME"
export APPIMAGE_NAME="pdf2htmlEX-$PDF2HTMLEX_BRANCH-$BUILD_TIME-$MACHINE_ARCH.AppImage"
echo "export APPIMAGE_NAME=\"$APPIMAGE_NAME\"" >> buildScripts/reSourceVersionEnvs
mkdir -p imageBuild/appDir/usr/lib/ mkdir -p imageBuild/appDir/usr/lib/

View File

@ -14,6 +14,32 @@ if [ -x "$(which docker)" ]; then
source buildScripts/dockerFunctions source buildScripts/dockerFunctions
if [ -z "$DOCKER_FROM" ]; then
echo ""
read -p "Enter the docker image for the 'from' base: " DOCKER_FROM
echo ""
if [ -z "$DOCKER_FROM" ]; then
echo "DOCKER_FROM not set... so we can not build the docker image"
exit 1
fi
fi
if [ -z "$DOCKER_USERNAME" ]; then
echo ""
read -p "Enter a docker username: " DOCKER_USERNAME
echo ""
if [ -z "$DOCKER_USERNAME" ]; then
echo "DOCKER_USERNAME not set... so we can not build the docker image"
exit 1
fi
fi
export DOCKER_NAME="$DOCKER_USERNAME/pdf2htmlex:$PDF2HTMLEX_BRANCH-$BUILD_TIME"
echo "export DOCKER_FROM=\"$DOCKER_FROM\"" >> buildScripts/reSourceVersionEnvs
echo "export DOCKER_USERNAME=\"$DOCKER_USERNAME\"" >> buildScripts/reSourceVersionEnvs
echo "export DOCKER_NAME=\"$DOCKER_NAME\"" >> buildScripts/reSourceVersionEnvs
mkdir -p imageBuild/dockerDir mkdir -p imageBuild/dockerDir
cd pdf2htmlEX/build cd pdf2htmlEX/build

48
buildScripts/uploadDockerImage Executable file
View File

@ -0,0 +1,48 @@
#!/bin/bash
# This bash script uploads the pdf2htmlEX docker image to docker hub
#
# We EXPECT the following environment variables to be set:
# 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
echo ""
echo "-------------------------------------------------------------------"
echo "UPLOADING pdf2htmlEX Docker Image to Docker Hub"
echo "-------------------------------------------------------------------"
echo ""
##################################
# push docker image
#
if [ -x "$(which docker)" ]; 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 ""
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 is not installed... skipping upload of docker image."
fi

View File

@ -73,7 +73,7 @@ echo $DOCKER_NAME > dockerImageName
deleteReleaseByTag "$TRAVIS_REPO_SLUG" "continuous" deleteReleaseByTag "$TRAVIS_REPO_SLUG" "continuous"
createNewRelease "$TRAVIS_REPO_SLUG" "continuous" "Latest release" \ createNewRelease "$TRAVIS_REPO_SLUG" "continuous" "Latest release" \
../buildScripts/uploadReleaseMessage ../buildScripts/uploadGitHubReleaseMessage
uploadAnAsset $upload_url appImageName "text/plain" uploadAnAsset $upload_url appImageName "text/plain"
uploadAnAsset $upload_url buildTime "text/plain" uploadAnAsset $upload_url buildTime "text/plain"

13
buildScripts/uploadImages Normal file
View File

@ -0,0 +1,13 @@
#!/bin/bash
# This bash script uploads already existing pdf2htmlEX AppImage and Docker
# Images
################
# do the uploads
./buildScripts/uploadGitHubRelease || { echo 'uploadGitHubRelease FAILED' ; exit 1 ; }
./buildScripts/uploadDockerImage || { echo 'uploadDockerImage FAILED' ; exit 1 ; }

View File

@ -11,24 +11,24 @@ export FONTFORGE_VERSION=20170731
if [ -z "$PDF2HTMLEX_BRANCH" ]; then if [ -z "$PDF2HTMLEX_BRANCH" ]; then
export PDF2HTMLEX_BRANCH="$(git rev-parse --abbrev-ref HEAD)" export PDF2HTMLEX_BRANCH="$(git rev-parse --abbrev-ref HEAD)"
if [ -z "$PDF2HTMLEX_BRANCH" ]; then
echo ""
read -p "Enter the pdf2htmlEX branch or version: " PDF2HTMLEX_BRANCH
echo ""
if [ -z "$PDF2HTMLEX_BRANCH" ]; then
echo "PDF2HTMLEX_BRANCH not set... so we can not build anything."
exit 1
fi
fi
fi fi
export MACHINE_ARCH="$(uname -m)" export MACHINE_ARCH="$(uname -m)"
export BUILD_TIME="$(date +%Y_%m_%d-%H_%M_%S)" export BUILD_TIME="$(date +%Y_%m_%d-%H_%M_%S)"
export DOCKER_FROM=ubuntu:18.04
export DOCKER_NAME="$DOCKER_USERNAME/pdf2htmlex:$PDF2HTMLEX_BRANCH-$BUILD_TIME"
export APPIMAGE_NAME="pdf2htmlEX-$PDF2HTMLEX_BRANCH-$BUILD_TIME-$MACHINE_ARCH.AppImage"
echo "export POPPLER_VERSION=\"$POPPLER_VERSION\"" > buildScripts/reSourceVersionEnvs echo "export POPPLER_VERSION=\"$POPPLER_VERSION\"" > buildScripts/reSourceVersionEnvs
echo "export FONTFORGE_VERSION=\"$FONTFORGE_VERSION\"" >> buildScripts/reSourceVersionEnvs echo "export FONTFORGE_VERSION=\"$FONTFORGE_VERSION\"" >> buildScripts/reSourceVersionEnvs
echo "export PDF2HTMLEX_BRANCH=\"$PDF2HTMLEX_BRANCH\"" >> buildScripts/reSourceVersionEnvs echo "export PDF2HTMLEX_BRANCH=\"$PDF2HTMLEX_BRANCH\"" >> buildScripts/reSourceVersionEnvs
echo "export MACHINE_ARCH=\"$MACHINE_ARCH\"" >> buildScripts/reSourceVersionEnvs echo "export MACHINE_ARCH=\"$MACHINE_ARCH\"" >> buildScripts/reSourceVersionEnvs
echo "export BUILD_TIME=\"$BUILD_TIME\"" >> buildScripts/reSourceVersionEnvs echo "export BUILD_TIME=\"$BUILD_TIME\"" >> buildScripts/reSourceVersionEnvs
echo "export DOCKER_FROM=\"$DOCKER_FROM\"" >> buildScripts/reSourceVersionEnvs
echo "export DOCKER_NAME=\"$DOCKER_NAME\"" >> buildScripts/reSourceVersionEnvs
echo "export APPIMAGE_NAME=\"$APPIMAGE_NAME\"" >> buildScripts/reSourceVersionEnvs