From 8fe76e30862348dc32b55846187b5a0283305542 Mon Sep 17 00:00:00 2001 From: Stephen Gaito Date: Thu, 28 Nov 2019 13:04:03 +0000 Subject: [PATCH] penultimage build tools --- buildScripts/createDockerImage | 2 +- buildScripts/uploadRelease | 13 ++++--------- buildScripts/versionEnvs | 1 + testScripts/doItAll | 18 +++++++++++------- testScripts/doItAllTravis | 29 ++++++++++++++++++++++++++++- 5 files changed, 45 insertions(+), 18 deletions(-) diff --git a/buildScripts/createDockerImage b/buildScripts/createDockerImage index 160684c..14ceb55 100755 --- a/buildScripts/createDockerImage +++ b/buildScripts/createDockerImage @@ -31,7 +31,7 @@ DOCKERFILE_HERE_DOC cd .. - docker build -t $DOCKER_USERNAME/pdf2htmlex:-`date +%Y_%m_%d-%H_%M_%S` dockerDir + docker build -t $DOCKER_USERNAME/pdf2htmlex:$PDF2THMLEX_BRANCH-$BUILD_TIME dockerDir else echo "Docker is not installed... skipping creation of a docker image." diff --git a/buildScripts/uploadRelease b/buildScripts/uploadRelease index 8a90567..c39427a 100755 --- a/buildScripts/uploadRelease +++ b/buildScripts/uploadRelease @@ -8,7 +8,6 @@ # # 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) # source ./buildScripts/reSourceVersionEnvs @@ -28,21 +27,15 @@ if [ -n "$GITHUB_TOKEN" ]; then echo $DOCKER_NAME > dockerImageName - if [ -z "$UPLOADTOOL_BODY" ]; then - export UPLOADTOOL_BODY=<> 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 diff --git a/testScripts/doItAll b/testScripts/doItAll index 665279a..a10e143 100644 --- a/testScripts/doItAll +++ b/testScripts/doItAll @@ -2,17 +2,21 @@ # This bash script automates the tests +mkdir -p testDir + +cd testDir + wget https://github.com/stephengaito/pdf2htmlEX/releases/download/continuous/appImageName -export APP_IMAGE_NAME=$(cat appImageName) +export APPIMAGE_NAME=$(cat appImageName) -wget https://github.com/stephengaito/pdf2htmlEX/releases/download/continuous/$APP_IMAGE_NAME +wget https://github.com/stephengaito/pdf2htmlEX/releases/download/continuous/$APPIMAGE_NAME -chmod a+x $APP_IMAGE_NAME +chmod a+x $APPIMAGE_NAME -if ! ./$APP_IMAGE_NAME --version ; then +if ! ./$APPIMAGE_NAME --version ; then echo "COULD NOT run the AppImage" - exit(-1) + exit 1 fi if [ -x "$(which docker)" ]; then @@ -22,8 +26,8 @@ if [ -x "$(which docker)" ]; then export DOCKER_IMAGE_NAME=$(cat dockerImageName) if ! docker run $DOCKER_IMAGE_NAME --version ; then - echo "COULD NOT run the AppImage" - exit(-1) + echo "COULD NOT run the Docker Image" + exit 1 fi fi diff --git a/testScripts/doItAllTravis b/testScripts/doItAllTravis index f01339e..695fd75 100644 --- a/testScripts/doItAllTravis +++ b/testScripts/doItAllTravis @@ -1,5 +1,32 @@ #!/bin/bash -# This bash script automates the tests on a TravisCI worker +# This bash script automates the tests + +wget https://github.com/stephengaito/pdf2htmlEX/releases/download/continuous/appImageName + +export APPIMAGE_NAME=$(cat appImageName) + +wget https://github.com/stephengaito/pdf2htmlEX/releases/download/continuous/$APPIMAGE_NAME + +chmod a+x $APPIMAGE_NAME + +if ! ./$APPIMAGE_NAME --version ; then + echo "COULD NOT run the AppImage" + exit 1 +fi + +if [ -x "$(which docker)" ]; then + + wget https://github.com/stephengaito/pdf2htmlEX/releases/download/continuous/dockerImageName + + export DOCKER_IMAGE_NAME=$(cat dockerImageName) + + if ! docker run $DOCKER_IMAGE_NAME --version ; then + echo "COULD NOT run the Docker Image" + exit 1 + fi + +fi +