From d58aaabd4d53d0e96683c42935fc8a38e6c9667b Mon Sep 17 00:00:00 2001 From: chbmb Date: Sun, 2 Jun 2019 16:03:09 +0100 Subject: [PATCH] Update release variable, readme & jenkins --- Dockerfile | 8 ++++---- Dockerfile.aarch64 | 8 ++++---- Dockerfile.armhf | 8 ++++---- Jenkinsfile | 18 +++++++++--------- README.md | 1 + jenkins-vars.yml | 6 +++--- readme-vars.yml | 1 + 7 files changed, 26 insertions(+), 24 deletions(-) diff --git a/Dockerfile b/Dockerfile index 0087b0a..7495412 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,7 +3,7 @@ FROM lsiobase/ubuntu:bionic # set version label ARG BUILD_DATE ARG VERSION -ARG CALIBRE_RELEASE +ARG CALIBREWEB_RELEASE LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}" LABEL maintainer="chbmb" @@ -18,13 +18,13 @@ RUN \ imagemagick \ python-minimal && \ echo "**** install calibre-web ****" && \ - if [ -z ${CALIBRE_RELEASE+x} ]; then \ - CALIBRE_RELEASE=$(curl -sX GET "https://api.github.com/repos/janeczku/calibre-web/releases/latest" \ + if [ -z ${CALIBREWEB_RELEASE+x} ]; then \ + CALIBREWEB_RELEASE=$(curl -sX GET "https://api.github.com/repos/janeczku/calibre-web/releases/latest" \ | awk '/tag_name/{print $4;exit}' FS='[""]'); \ fi && \ curl -o \ /tmp/calibre-web.tar.gz -L \ - https://github.com/janeczku/calibre-web/archive/${CALIBRE_RELEASE}.tar.gz && \ + https://github.com/janeczku/calibre-web/archive/${CALIBREWEB_RELEASE}.tar.gz && \ mkdir -p \ /app/calibre-web && \ tar xf \ diff --git a/Dockerfile.aarch64 b/Dockerfile.aarch64 index e6e466b..f4870ff 100644 --- a/Dockerfile.aarch64 +++ b/Dockerfile.aarch64 @@ -3,7 +3,7 @@ FROM lsiobase/ubuntu:arm64v8-bionic # set version label ARG BUILD_DATE ARG VERSION -ARG CALIBRE_RELEASE +ARG CALIBREWEB_RELEASE LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}" LABEL maintainer="chbmb" @@ -18,13 +18,13 @@ RUN \ imagemagick \ python-minimal && \ echo "**** install calibre-web ****" && \ - if [ -z ${CALIBRE_RELEASE+x} ]; then \ - CALIBRE_RELEASE=$(curl -sX GET "https://api.github.com/repos/janeczku/calibre-web/releases/latest" \ + if [ -z ${CALIBREWEB_RELEASE+x} ]; then \ + CALIBREWEB_RELEASE=$(curl -sX GET "https://api.github.com/repos/janeczku/calibre-web/releases/latest" \ | awk '/tag_name/{print $4;exit}' FS='[""]'); \ fi && \ curl -o \ /tmp/calibre-web.tar.gz -L \ - https://github.com/janeczku/calibre-web/archive/${CALIBRE_RELEASE}.tar.gz && \ + https://github.com/janeczku/calibre-web/archive/${CALIBREWEB_RELEASE}.tar.gz && \ mkdir -p \ /app/calibre-web && \ tar xf \ diff --git a/Dockerfile.armhf b/Dockerfile.armhf index 4dafbca..d84dfa3 100644 --- a/Dockerfile.armhf +++ b/Dockerfile.armhf @@ -3,7 +3,7 @@ FROM lsiobase/ubuntu:arm32v7-bionic # set version label ARG BUILD_DATE ARG VERSION -ARG CALIBRE_RELEASE +ARG CALIBREWEB_RELEASE LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}" LABEL maintainer="chbmb" @@ -18,13 +18,13 @@ RUN \ imagemagick \ python-minimal && \ echo "**** install calibre-web ****" && \ - if [ -z ${CALIBRE_RELEASE+x} ]; then \ - CALIBRE_RELEASE=$(curl -sX GET "https://api.github.com/repos/janeczku/calibre-web/releases/latest" \ + if [ -z ${CALIBREWEB_RELEASE+x} ]; then \ + CALIBREWEB_RELEASE=$(curl -sX GET "https://api.github.com/repos/janeczku/calibre-web/releases/latest" \ | awk '/tag_name/{print $4;exit}' FS='[""]'); \ fi && \ curl -o \ /tmp/calibre-web.tar.gz -L \ - https://github.com/janeczku/calibre-web/archive/${CALIBRE_RELEASE}.tar.gz && \ + https://github.com/janeczku/calibre-web/archive/${CALIBREWEB_RELEASE}.tar.gz && \ mkdir -p \ /app/calibre-web && \ tar xf \ diff --git a/Jenkinsfile b/Jenkinsfile index 4f993f8..7bc6d9e 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -13,14 +13,14 @@ pipeline { EXT_GIT_BRANCH = 'master' EXT_USER = 'janeczku' EXT_REPO = 'calibre-web' - BUILD_VERSION_ARG = 'CALIBRE_COMMIT' + BUILD_VERSION_ARG = 'CALIBREWEB_RELEASE' LS_USER = 'linuxserver' LS_REPO = 'docker-calibre-web' CONTAINER_NAME = 'calibre-web' DOCKERHUB_IMAGE = 'linuxserver/calibre-web' DEV_DOCKERHUB_IMAGE = 'lsiodev/calibre-web' PR_DOCKERHUB_IMAGE = 'lspipepr/calibre-web' - DIST_IMAGE = 'alpine' + DIST_IMAGE = 'ubuntu' MULTIARCH='true' CI='true' CI_WEB='true' @@ -102,21 +102,21 @@ pipeline { /* ######################## External Release Tagging ######################## */ - // If this is a github commit trigger determine the current commit at head - stage("Set ENV github_commit"){ + // If this is a stable github release use the latest endpoint from github to determine the ext tag + stage("Set ENV github_stable"){ steps{ script{ env.EXT_RELEASE = sh( - script: '''curl -s https://api.github.com/repos/${EXT_USER}/${EXT_REPO}/commits/${EXT_GIT_BRANCH} | jq -r '. | .sha' | cut -c1-8 ''', + script: '''curl -s https://api.github.com/repos/${EXT_USER}/${EXT_REPO}/releases/latest | jq -r '. | .tag_name' ''', returnStdout: true).trim() } } } - // If this is a github commit trigger Set the external release link - stage("Set ENV commit_link"){ + // If this is a stable or devel github release generate the link for the build message + stage("Set ENV github_link"){ steps{ script{ - env.RELEASE_LINK = 'https://github.com/' + env.EXT_USER + '/' + env.EXT_REPO + '/commit/' + env.EXT_RELEASE + env.RELEASE_LINK = 'https://github.com/' + env.EXT_USER + '/' + env.EXT_REPO + '/releases/tag/' + env.EXT_RELEASE } } } @@ -604,7 +604,7 @@ pipeline { "tagger": {"name": "LinuxServer Jenkins","email": "jenkins@linuxserver.io","date": "'${GITHUB_DATE}'"}}' ''' echo "Pushing New release for Tag" sh '''#! /bin/bash - curl -s https://api.github.com/repos/${EXT_USER}/${EXT_REPO}/commits/${EXT_GIT_BRANCH} | jq '. | .commit.message' | sed 's:^.\\(.*\\).$:\\1:' > releasebody.json + curl -s https://api.github.com/repos/${EXT_USER}/${EXT_REPO}/releases/latest | jq '. |.body' | sed 's:^.\\(.*\\).$:\\1:' > releasebody.json echo '{"tag_name":"'${EXT_RELEASE_CLEAN}'-ls'${LS_TAG_NUMBER}'",\ "target_commitish": "master",\ "name": "'${EXT_RELEASE_CLEAN}'-ls'${LS_TAG_NUMBER}'",\ diff --git a/README.md b/README.md index c9f0517..eadf91f 100644 --- a/README.md +++ b/README.md @@ -199,6 +199,7 @@ Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64 ## Versions +* **02.06.19:** - Rebase to Ubuntu Bionic & add Gdrive support. * **23.03.19:** - Switching to new Base images, shift to arm32v7 tag. * **23.02.19:** - Rebase to alpine 3.9, use repo version of imagemagick. * **11.02.19:** - Add pipeline logic and multi arch. diff --git a/jenkins-vars.yml b/jenkins-vars.yml index 5271e2c..f31a209 100644 --- a/jenkins-vars.yml +++ b/jenkins-vars.yml @@ -2,7 +2,7 @@ # jenkins variables project_name: docker-calibre-web -external_type: github_commit +external_type: github_stable release_type: stable release_tag: latest ls_branch: master @@ -10,14 +10,14 @@ repo_vars: - EXT_GIT_BRANCH = 'master' - EXT_USER = 'janeczku' - EXT_REPO = 'calibre-web' - - BUILD_VERSION_ARG = 'CALIBRE_COMMIT' + - BUILD_VERSION_ARG = 'CALIBREWEB_RELEASE' - LS_USER = 'linuxserver' - LS_REPO = 'docker-calibre-web' - CONTAINER_NAME = 'calibre-web' - DOCKERHUB_IMAGE = 'linuxserver/calibre-web' - DEV_DOCKERHUB_IMAGE = 'lsiodev/calibre-web' - PR_DOCKERHUB_IMAGE = 'lspipepr/calibre-web' - - DIST_IMAGE = 'alpine' + - DIST_IMAGE = 'ubuntu' - MULTIARCH='true' - CI='true' - CI_WEB='true' diff --git a/readme-vars.yml b/readme-vars.yml index 2989580..493cc2b 100644 --- a/readme-vars.yml +++ b/readme-vars.yml @@ -69,6 +69,7 @@ app_setup_block: | # changelog changelogs: + - { date: "02.06.19:", desc: "Rebase to Ubuntu Bionic & add Gdrive support." } - { date: "23.03.19:", desc: "Switching to new Base images, shift to arm32v7 tag." } - { date: "23.02.19:", desc: "Rebase to alpine 3.9, use repo version of imagemagick." } - { date: "11.02.19:", desc: "Add pipeline logic and multi arch." }