From 35802476cdded88374fbf7b4a61affe6708bb747 Mon Sep 17 00:00:00 2001 From: Homer Date: Fri, 6 Jul 2018 08:34:57 +0100 Subject: [PATCH 1/4] fixed broken echo lines and now using thelamer github release logic --- Dockerfile.aarch64 | 14 +++++++++----- Dockerfile.amd64 | 16 +++++++++------- Dockerfile.armhf | 14 +++++++++----- 3 files changed, 27 insertions(+), 17 deletions(-) diff --git a/Dockerfile.aarch64 b/Dockerfile.aarch64 index 72aeb88..0c10a4b 100644 --- a/Dockerfile.aarch64 +++ b/Dockerfile.aarch64 @@ -7,6 +7,7 @@ COPY qemu-aarch64-static /usr/bin # set version label ARG BUILD_DATE ARG VERSION +ARG BOOKSTACK_RELEASE LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}" LABEL maintainer="homerr" @@ -36,14 +37,17 @@ echo "**** configure php-fpm to pass env vars ****" && \ echo "**** get bookstack ****" && \ -BSAPP_VER="$(curl -sX GET https://api.github.com/repos/BookStackApp/BookStack/releases/latest | grep 'tag_name' | cut -d\" -f4)" && \ - mkdir -p\ /var/www/html && \ +if [ -z ${BOOKSTACK_RELEASE+x} ]; then \ + BOOKSTACK_RELEASE=$(curl -sX GET "https://api.github.com/repos/bookstackapp/bookstack/releases/latest" \ + | awk '/tag_name/{print $4;exit}' FS='[""]'); \ +fi && \ + curl -o \ -/tmp/bookstack.tar.gz -L \ - "https://github.com/BookStackApp/BookStack/archive/${BSAPP_VER}.tar.gz" && \ + /tmp/bookstack.tar.gz -L \ + "https://github.com/BookStackApp/BookStack/archive/${BOOKSTACK_RELEASE}.tar.gz" && \ tar xf \ /tmp/bookstack.tar.gz -C \ @@ -57,7 +61,7 @@ cd /tmp && \ curl -sS https://getcomposer.org/installer | php && \ mv /tmp/composer.phar /usr/local/bin/composer && \ -echo "**** run composer install ****" +echo "**** run composer install ****" && \ composer install -d /var/www/html/ && \ diff --git a/Dockerfile.amd64 b/Dockerfile.amd64 index acbd3b5..ffb128b 100644 --- a/Dockerfile.amd64 +++ b/Dockerfile.amd64 @@ -1,11 +1,10 @@ -# using ideas/code from other sparklyballs templates -# set variable to get archive based on github api data (sparklyballs heimdall inspiration) - +# using ideas/code from other thelamer & sparklyballs lsio templates FROM lsiobase/alpine.nginx:3.7 # set version label ARG BUILD_DATE ARG VERSION +ARG BOOKSTACK_RELEASE LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}" LABEL maintainer="homerr" @@ -35,14 +34,17 @@ echo "**** configure php-fpm to pass env vars ****" && \ echo "**** get bookstack ****" && \ -BSAPP_VER="$(curl -sX GET https://api.github.com/repos/BookStackApp/BookStack/releases/latest | grep 'tag_name' | cut -d\" -f4)" && \ - mkdir -p\ /var/www/html && \ +if [ -z ${BOOKSTACK_RELEASE+x} ]; then \ + BOOKSTACK_RELEASE=$(curl -sX GET "https://api.github.com/repos/bookstackapp/bookstack/releases/latest" \ + | awk '/tag_name/{print $4;exit}' FS='[""]'); \ +fi && \ + curl -o \ /tmp/bookstack.tar.gz -L \ - "https://github.com/BookStackApp/BookStack/archive/${BSAPP_VER}.tar.gz" && \ + "https://github.com/BookStackApp/BookStack/archive/${BOOKSTACK_RELEASE}.tar.gz" && \ tar xf \ /tmp/bookstack.tar.gz -C \ @@ -56,7 +58,7 @@ cd /tmp && \ curl -sS https://getcomposer.org/installer | php && \ mv /tmp/composer.phar /usr/local/bin/composer && \ -echo "**** run composer install ****" +echo "**** run composer install ****" && \ composer install -d /var/www/html/ && \ diff --git a/Dockerfile.armhf b/Dockerfile.armhf index 6091cfb..682d031 100644 --- a/Dockerfile.armhf +++ b/Dockerfile.armhf @@ -7,6 +7,7 @@ COPY qemu-arm-static /usr/bin # set version label ARG BUILD_DATE ARG VERSION +ARG BOOKSTACK_RELEASE LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}" LABEL maintainer="homerr" @@ -36,14 +37,17 @@ echo "**** configure php-fpm to pass env vars ****" && \ echo "**** get bookstack ****" && \ -BSAPP_VER="$(curl -sX GET https://api.github.com/repos/BookStackApp/BookStack/releases/latest | grep 'tag_name' | cut -d\" -f4)" && \ - mkdir -p\ /var/www/html && \ +if [ -z ${BOOKSTACK_RELEASE+x} ]; then \ + BOOKSTACK_RELEASE=$(curl -sX GET "https://api.github.com/repos/bookstackapp/bookstack/releases/latest" \ + | awk '/tag_name/{print $4;exit}' FS='[""]'); \ +fi && \ + curl -o \ -/tmp/bookstack.tar.gz -L \ - "https://github.com/BookStackApp/BookStack/archive/${BSAPP_VER}.tar.gz" && \ + /tmp/bookstack.tar.gz -L \ + "https://github.com/BookStackApp/BookStack/archive/${BOOKSTACK_RELEASE}.tar.gz" && \ tar xf \ /tmp/bookstack.tar.gz -C \ @@ -57,7 +61,7 @@ cd /tmp && \ curl -sS https://getcomposer.org/installer | php && \ mv /tmp/composer.phar /usr/local/bin/composer && \ -echo "**** run composer install ****" +echo "**** run composer install ****" && \ composer install -d /var/www/html/ && \ From 831050fef03a93f158336a9993d7206578e5cab4 Mon Sep 17 00:00:00 2001 From: Homerr Date: Fri, 6 Jul 2018 09:29:30 +0100 Subject: [PATCH 2/4] chmod on qemu files modified: qemu-aarch64-static modified: qemu-arm-static --- qemu-aarch64-static | Bin qemu-arm-static | Bin 2 files changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 qemu-aarch64-static mode change 100644 => 100755 qemu-arm-static diff --git a/qemu-aarch64-static b/qemu-aarch64-static old mode 100644 new mode 100755 diff --git a/qemu-arm-static b/qemu-arm-static old mode 100644 new mode 100755 From d92e45ff5b40cb7dbc4ea791e539ddcb218e105e Mon Sep 17 00:00:00 2001 From: Homer Date: Fri, 13 Jul 2018 13:27:42 +0100 Subject: [PATCH 3/4] missing php package & incorrect variable in config file fixed --- Dockerfile.aarch64 | 1 + Dockerfile.amd64 | 1 + Dockerfile.armhf | 1 + root/etc/cont-init.d/50-config | 2 +- 4 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Dockerfile.aarch64 b/Dockerfile.aarch64 index 0c10a4b..fc4048d 100644 --- a/Dockerfile.aarch64 +++ b/Dockerfile.aarch64 @@ -27,6 +27,7 @@ apk add --no-cache \ php7-mysqlnd \ php7-tidy \ php7-simplexml \ + php7-ctype \ tar && \ echo "**** configure php-fpm to pass env vars ****" && \ diff --git a/Dockerfile.amd64 b/Dockerfile.amd64 index ffb128b..25acc24 100644 --- a/Dockerfile.amd64 +++ b/Dockerfile.amd64 @@ -24,6 +24,7 @@ apk add --no-cache \ php7-mysqlnd \ php7-tidy \ php7-simplexml \ + php7-ctype \ tar && \ echo "**** configure php-fpm to pass env vars ****" && \ diff --git a/Dockerfile.armhf b/Dockerfile.armhf index 682d031..ca43340 100644 --- a/Dockerfile.armhf +++ b/Dockerfile.armhf @@ -27,6 +27,7 @@ apk add --no-cache \ php7-mysqlnd \ php7-tidy \ php7-simplexml \ + php7-ctype \ tar && \ echo "**** configure php-fpm to pass env vars ****" && \ diff --git a/root/etc/cont-init.d/50-config b/root/etc/cont-init.d/50-config index 33f5fd8..801cf18 100644 --- a/root/etc/cont-init.d/50-config +++ b/root/etc/cont-init.d/50-config @@ -34,7 +34,7 @@ sed -i "s/DB_HOST=localhost/DB_HOST=${DB_HOST}/g" /var/www/html/.env sed -i "s/DB_DATABASE=database_database/DB_DATABASE=${DB_DATABASE}/g" /var/www/html/.env -sed -i "s/DB_USERNAME=database_username/DB_USER=${DB_USER}/g" /var/www/html/.env +sed -i "s/DB_USERNAME=database_username/DB_USERNAME=${DB_USER}/g" /var/www/html/.env sed -i "s/DB_PASSWORD=database_user_password/DB_PASSWORD=${DB_PASS}/g" /var/www/html/.env From a98a300e2ab63513ee79e1ec47f6b4325eff3473 Mon Sep 17 00:00:00 2001 From: Homer Date: Fri, 13 Jul 2018 13:45:04 +0100 Subject: [PATCH 4/4] added purge for manifest builds --- Jenkinsfile | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 214831e..2dd63ea 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -495,8 +495,8 @@ pipeline { sh "docker manifest annotate ${DOCKERHUB_IMAGE}:${EXT_RELEASE}-ls${LS_TAG_NUMBER} ${DOCKERHUB_IMAGE}:arm32v6-${EXT_RELEASE}-ls${LS_TAG_NUMBER} --os linux --arch arm" sh "docker manifest annotate ${DOCKERHUB_IMAGE}:${EXT_RELEASE}-ls${LS_TAG_NUMBER} ${DOCKERHUB_IMAGE}:arm64v8-${EXT_RELEASE}-ls${LS_TAG_NUMBER} --os linux --arch arm64 --variant armv8" echo 'Pushing by manifest tags' - sh "docker manifest push ${DOCKERHUB_IMAGE}:latest" - sh "docker manifest push ${DOCKERHUB_IMAGE}:${EXT_RELEASE}-ls${LS_TAG_NUMBER}" + sh "docker manifest push --purge ${DOCKERHUB_IMAGE}:latest" + sh "docker manifest push --purge ${DOCKERHUB_IMAGE}:${EXT_RELEASE}-ls${LS_TAG_NUMBER}" } } } @@ -717,8 +717,8 @@ pipeline { sh "docker manifest annotate ${DEV_DOCKERHUB_IMAGE}:${EXT_RELEASE}-pkg-${PACKAGE_TAG}-dev-${COMMIT_SHA} ${DEV_DOCKERHUB_IMAGE}:arm32v6-${EXT_RELEASE}-pkg-${PACKAGE_TAG}-dev-${COMMIT_SHA} --os linux --arch arm" sh "docker manifest annotate ${DEV_DOCKERHUB_IMAGE}:${EXT_RELEASE}-pkg-${PACKAGE_TAG}-dev-${COMMIT_SHA} ${DEV_DOCKERHUB_IMAGE}:arm64v8-${EXT_RELEASE}-pkg-${PACKAGE_TAG}-dev-${COMMIT_SHA} --os linux --arch arm64 --variant armv8" echo 'Pushing by manifest tags' - sh "docker manifest push ${DEV_DOCKERHUB_IMAGE}:latest" - sh "docker manifest push ${DEV_DOCKERHUB_IMAGE}:${EXT_RELEASE}-pkg-${PACKAGE_TAG}-dev-${COMMIT_SHA}" + sh "docker manifest push --purge ${DEV_DOCKERHUB_IMAGE}:latest" + sh "docker manifest push --purge ${DEV_DOCKERHUB_IMAGE}:${EXT_RELEASE}-pkg-${PACKAGE_TAG}-dev-${COMMIT_SHA}" } script{ env.DOCKERHUB_LINK = sh( @@ -815,8 +815,8 @@ pipeline { sh "docker manifest annotate ${PR_DOCKERHUB_IMAGE}:${EXT_RELEASE}-pkg-${PACKAGE_TAG}-pr-${PULL_REQUEST} ${PR_DOCKERHUB_IMAGE}:arm32v6-${EXT_RELEASE}-pkg-${PACKAGE_TAG}-pr-${PULL_REQUEST} --os linux --arch arm" sh "docker manifest annotate ${PR_DOCKERHUB_IMAGE}:${EXT_RELEASE}-pkg-${PACKAGE_TAG}-pr-${PULL_REQUEST} ${PR_DOCKERHUB_IMAGE}:arm64v8-${EXT_RELEASE}-pkg-${PACKAGE_TAG}-pr-${PULL_REQUEST} --os linux --arch arm64 --variant armv8" echo 'Pushing by manifest tags' - sh "docker manifest push ${PR_DOCKERHUB_IMAGE}:latest" - sh "docker manifest push ${PR_DOCKERHUB_IMAGE}:${EXT_RELEASE}-pkg-${PACKAGE_TAG}-pr-${PULL_REQUEST}" + sh "docker manifest push --purge ${PR_DOCKERHUB_IMAGE}:latest" + sh "docker manifest push --purge ${PR_DOCKERHUB_IMAGE}:${EXT_RELEASE}-pkg-${PACKAGE_TAG}-pr-${PULL_REQUEST}" } script{ env.CODE_URL = sh(