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

refactored upload

This commit is contained in:
Stephen Gaito 2019-11-28 09:07:49 +00:00
parent 4006c6ebc9
commit 7f4f72fb05
8 changed files with 100 additions and 33 deletions

View File

@ -24,12 +24,6 @@ branches:
except: # do not build tags that we create using the upload.sh script except: # do not build tags that we create using the upload.sh script
- /^(?i:continuous.*)$/ - /^(?i:continuous.*)$/
env:
global:
- UNATTENDED="--assume-yes"
- FORCE_REINSTALL="--reinstall"
## - UPLOADTOOL_SUFFIX="test-$TRAVIS_BRANCH-$(date +%Y_%m_%d-%H_%M_%S)"
#addons: #addons:
# apt: # apt:
# update: true # update: true
@ -88,7 +82,7 @@ matrix:
# - os: osx # Until the build passes, then re-enable. # - os: osx # Until the build passes, then re-enable.
script: script:
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin - ./buildScripts/travisEnvs || travis_terminate 1;
- ./buildScripts/reportEnvs || travis_terminate 1; - ./buildScripts/reportEnvs || travis_terminate 1;
- ./buildScripts/getBuildTools || travis_terminate 1; - ./buildScripts/getBuildTools || travis_terminate 1;
- ./buildScripts/getDevLibraries || travis_terminate 1; - ./buildScripts/getDevLibraries || travis_terminate 1;
@ -102,7 +96,7 @@ script:
- ./buildScripts/installPdf2htmlEX || travis_terminate 1; - ./buildScripts/installPdf2htmlEX || travis_terminate 1;
- ./buildScripts/createAppImage || travis_terminate 1; - ./buildScripts/createAppImage || travis_terminate 1;
- ./buildScripts/createDockerImage || travis_terminate 1; - ./buildScripts/createDockerImage || travis_terminate 1;
- docker push $DOCKER_USERNAME/pdf2htmlex - ./buildScripts/uploadRelease || travis_terminate 1;
#deploy: #deploy:
# provider: releases # provider: releases

View File

@ -6,8 +6,7 @@ source buildScripts/versionEnvs
# For appimage output plugin # For appimage output plugin
# #
export VERSION="$PDF2HTMLEX_VERSION-$(date +%Y_%m_%d-%H_%M_%S)" export VERSION="$PDF2HTMLEX_BRANCH-$BUILD_TIME"
export UPLOADTOOL_BODY="This is the development/testing release of the pdf2htmlEX AppImage.\n\nYou can download the AppImage and 'just run it'.\n\nSee: https://appimage.org/ "
mkdir -p imageBuild/appDir/usr/lib/ mkdir -p imageBuild/appDir/usr/lib/
@ -36,8 +35,4 @@ chmod a+x $LINUX_DEPLOY_APP_IMAGE
--appdir=appDir \ --appdir=appDir \
--output appimage --output appimage
wget -c https://github.com/probonopd/uploadtool/raw/master/upload.sh
bash upload.sh pdf2htmlEX*.AppImage

View File

@ -31,7 +31,7 @@ DOCKERFILE_HERE_DOC
cd .. cd ..
docker build -t stephengaito/pdf2htmlex:test-`date +%Y_%m_%d-%H_%M_%S` dockerDir docker build -t $DOCKER_USERNAME/pdf2htmlex:-`date +%Y_%m_%d-%H_%M_%S` dockerDir
else else
echo "Docker is not installed... skipping creation of a docker image." echo "Docker is not installed... skipping creation of a docker image."

View File

@ -3,14 +3,14 @@
# This bash script automates the process of getting the original pdf2htmlEX # This bash script automates the process of getting the original pdf2htmlEX
# source # source
PDF2HTMLEX_VERSION=newBuildSystem PDF2HTMLEX_BRANCH=newBuildSystem
wget https://codeload.github.com/stephengaito/pdf2htmlEX/zip/$PDF2HTMLEX_VERSION wget https://codeload.github.com/stephengaito/pdf2htmlEX/zip/$PDF2HTMLEX_BRANCH
mv $PDF2HTMLEX_VERSION $PDF2HTMLEX_VERSION.zip mv $PDF2HTMLEX_BRANCH $PDF2HTMLEX_BRANCH.zip
sudo apt install unzip sudo apt install unzip
unzip $PDF2HTMLEX_VERSION.zip unzip $PDF2HTMLEX_BRANCH.zip
mv pdf2htmlEX-$PDF2HTMLEX_VERSION pdf2htmlEX mv pdf2htmlEX-$PDF2HTMLEX_BRANCH pdf2htmlEX

View File

@ -3,20 +3,25 @@
# This bash script reports the more important TRAVIS environment variables # This bash script reports the more important TRAVIS environment variables
echo "TravisCI env:" echo "TravisCI env:"
echo " tag: [$TRAVIS_TAG]" echo " tag: [$TRAVIS_TAG]"
echo " branch: [$TRAVIS_BRANCH]" echo " branch: [$TRAVIS_BRANCH]"
echo " commit: [$TRAVIS_COMMIT]" echo " commit: [$TRAVIS_COMMIT]"
echo " build dir: [$TRAVIS_BUILD_DIR]" echo " build dir: [$TRAVIS_BUILD_DIR]"
echo " repo slug: [$TRAVIS_REPO_SLUG]" echo " repo slug: [$TRAVIS_REPO_SLUG]"
echo "UploadTool env:" echo "UploadTool env:"
echo " suffix: [$UPLOADTOOL_SUFFIX]" echo " suffix: [$UPLOADTOOL_SUFFIX]"
source ./buildScripts/versionEnvs source ./buildScripts/versionEnvs
echo "pdf2htmlEX env:" echo "pdf2htmlEX env:"
echo " poppler: [$POPPLER_VERSION]" echo " poppler: [$POPPLER_VERSION]"
echo " fontforge: [$FONTFORGE_VERSION]" echo " fontforge: [$FONTFORGE_VERSION]"
echo " pdf2htmlEX: [$PDF2HTMLEX_VERSION]" echo " pdf2htmlEX: [$PDF2HTMLEX_BRANCH]"
echo " docker from: [$DOCKER_FROM]" echo " machine arch: [$MACHINE_ARCH]"
echo "machine arch: [$MACHINE_ARCH]"
echo "release env:"
echo " build time: [$BUILD_TIME]"
echo " docker from: [$DOCKER_FROM]"
echo " docker name: [$DOCKER_NAME]"
echo "appImage name: [$APPIMAGE_NAME]"

View File

@ -1,2 +1,3 @@
export UNATTENDED="--assume-yes"
export MAKE_PARALLEL="-j `nproc`" export MAKE_PARALLEL="-j `nproc`"

65
buildScripts/uploadRelease Executable file
View File

@ -0,0 +1,65 @@
#!/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)
# UPLOADTOOL_BODY (the text of the github release message)
#
##################################
# upload github release artefacts
#
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
if [ -z "$UPLOADTOOL_BODY" ]; then
export UPLOADTOOL_BODY=<<RELEASE_MESSAGE
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
fi
bash upload.sh $APPIMAGE_NAME appImageName dockerImageName
else
echo "GITHUG_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_PASSWORD" ]; then
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

View File

@ -9,9 +9,16 @@ export POPPLER_VERSION=poppler-0.81.0
#export FONTFORGE_VERSION=20190801 #export FONTFORGE_VERSION=20190801
export FONTFORGE_VERSION=20170731 export FONTFORGE_VERSION=20170731
export PDF2HTMLEX_VERSION=newBuildSystem export PDF2HTMLEX_BRANCH="$(git rev-parse --abbrev-ref HEAD)"
export MACHINE_ARCH=`uname -m` export MACHINE_ARCH="$(uname -m)"
export BUILD_TIME="$(date +%Y_%m_%d-%H_%M_%S)"
export DOCKER_FROM=ubuntu:18.04 export DOCKER_FROM=ubuntu:18.04
export DOCKER_NAME="$DOCKER_USERNAME/pdf2htmlex:$PDF2HTMLEX_BRANCH-$BUILD_TIME"
export APPIMAGE_NAME="pdf2htmlEX-$PDF2HTML_BRANCH-$BUILD_TIME-$MACHINE_ARCH.AppImage"