diff --git a/.github/workflows/external_trigger.yml b/.github/workflows/external_trigger.yml index 0e82edd..42d94f6 100755 --- a/.github/workflows/external_trigger.yml +++ b/.github/workflows/external_trigger.yml @@ -18,7 +18,7 @@ jobs: fi echo "**** External trigger running off of master branch. To disable this trigger, set a Github secret named \"PAUSE_EXTERNAL_TRIGGER_NEXTCLOUD_MASTER\". ****" echo "**** Retrieving external version ****" - EXT_RELEASE=$(curl -s https://raw.githubusercontent.com/nextcloud/nextcloud.com/master/strings.php | awk -F\' '/VERSIONS_SERVER_FULL_STABLE/ {print $2;exit}') + EXT_RELEASE=$(curl -u ${{ secrets.CR_USER }}:${{ secrets.CR_PAT }} -sX GET https://api.github.com/repos/nextcloud/server/releases/latest | jq -r '. | .tag_name' | sed 's|^v||') if [ -z "${EXT_RELEASE}" ] || [ "${EXT_RELEASE}" == "null" ]; then echo "**** Can't retrieve external version, exiting ****" FAILURE_REASON="Can't retrieve external version for nextcloud branch master" diff --git a/Dockerfile b/Dockerfile index 19e23c0..d429c6e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -96,12 +96,16 @@ RUN \ echo "env[PATH] = /usr/local/bin:/usr/bin:/bin" >> /etc/php7/php-fpm.conf && \ echo "**** set version tag ****" && \ if [ -z ${NEXTCLOUD_RELEASE+x} ]; then \ - NEXTCLOUD_RELEASE=$(curl -s https://raw.githubusercontent.com/nextcloud/nextcloud.com/master/strings.php \ - | awk -F\' '/VERSIONS_SERVER_FULL_STABLE/ {print $2;exit}'); \ + NEXTCLOUD_RELEASE=$(curl -sX GET https://api.github.com/repos/nextcloud/server/releases/latest \ + | awk '/tag_name/{print $4;exit}' FS='[""]' \ + | sed 's|^v||'); \ fi && \ echo "**** download nextcloud ****" && \ curl -o /app/nextcloud.tar.bz2 -L \ https://download.nextcloud.com/server/releases/nextcloud-${NEXTCLOUD_RELEASE}.tar.bz2 && \ + echo "**** test tarball ****" && \ + tar xvf /app/nextcloud.tar.bz2 -C \ + /tmp && \ echo "**** cleanup ****" && \ apk del --purge \ build-dependencies && \ diff --git a/Dockerfile.aarch64 b/Dockerfile.aarch64 index d057345..ed93a65 100644 --- a/Dockerfile.aarch64 +++ b/Dockerfile.aarch64 @@ -96,12 +96,16 @@ RUN \ echo "env[PATH] = /usr/local/bin:/usr/bin:/bin" >> /etc/php7/php-fpm.conf && \ echo "**** set version tag ****" && \ if [ -z ${NEXTCLOUD_RELEASE+x} ]; then \ - NEXTCLOUD_RELEASE=$(curl -s https://raw.githubusercontent.com/nextcloud/nextcloud.com/master/strings.php \ - | awk -F\' '/VERSIONS_SERVER_FULL_STABLE/ {print $2;exit}'); \ + NEXTCLOUD_RELEASE=$(curl -sX GET https://api.github.com/repos/nextcloud/server/releases/latest \ + | awk '/tag_name/{print $4;exit}' FS='[""]' \ + | sed 's|^v||'); \ fi && \ echo "**** download nextcloud ****" && \ curl -o /app/nextcloud.tar.bz2 -L \ https://download.nextcloud.com/server/releases/nextcloud-${NEXTCLOUD_RELEASE}.tar.bz2 && \ + echo "**** test tarball ****" && \ + tar xvf /app/nextcloud.tar.bz2 -C \ + /tmp && \ echo "**** cleanup ****" && \ apk del --purge \ build-dependencies && \ diff --git a/Dockerfile.armhf b/Dockerfile.armhf index c6defe3..df8c08c 100644 --- a/Dockerfile.armhf +++ b/Dockerfile.armhf @@ -96,12 +96,16 @@ RUN \ echo "env[PATH] = /usr/local/bin:/usr/bin:/bin" >> /etc/php7/php-fpm.conf && \ echo "**** set version tag ****" && \ if [ -z ${NEXTCLOUD_RELEASE+x} ]; then \ - NEXTCLOUD_RELEASE=$(curl -s https://raw.githubusercontent.com/nextcloud/nextcloud.com/master/strings.php \ - | awk -F\' '/VERSIONS_SERVER_FULL_STABLE/ {print $2;exit}'); \ + NEXTCLOUD_RELEASE=$(curl -sX GET https://api.github.com/repos/nextcloud/server/releases/latest \ + | awk '/tag_name/{print $4;exit}' FS='[""]' \ + | sed 's|^v||'); \ fi && \ echo "**** download nextcloud ****" && \ curl -o /app/nextcloud.tar.bz2 -L \ https://download.nextcloud.com/server/releases/nextcloud-${NEXTCLOUD_RELEASE}.tar.bz2 && \ + echo "**** test tarball ****" && \ + tar xvf /app/nextcloud.tar.bz2 -C \ + /tmp && \ echo "**** cleanup ****" && \ apk del --purge \ build-dependencies && \ diff --git a/Jenkinsfile b/Jenkinsfile index 260ecec..88b9241 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -104,7 +104,7 @@ pipeline { steps{ script{ env.EXT_RELEASE = sh( - script: ''' curl -s https://raw.githubusercontent.com/nextcloud/nextcloud.com/master/strings.php | awk -F\\' '/VERSIONS_SERVER_FULL_STABLE/ {print $2;exit}' ''', + script: ''' curl -sX GET https://api.github.com/repos/nextcloud/server/releases/latest | jq -r '. | .tag_name' | sed 's|^v||' ''', returnStdout: true).trim() env.RELEASE_LINK = 'custom_command' } diff --git a/README.md b/README.md index f0f24aa..adec5c7 100644 --- a/README.md +++ b/README.md @@ -257,6 +257,7 @@ Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64 ## Versions +* **21.05.22:** - Update version check endpoint. * **28.04.22:** - Increase OPCache interned strings buffered setting to 16. * **14.04.22:** - Nginx default site config updated for v23 (existing users should delete `/config/nginx/site-confs/default` and restart the container). Fix LDAP connection. * **11.09.21:** - Rebasing to alpine 3.14 diff --git a/jenkins-vars.yml b/jenkins-vars.yml index 1953b8a..dd32663 100644 --- a/jenkins-vars.yml +++ b/jenkins-vars.yml @@ -3,7 +3,7 @@ # jenkins variables project_name: docker-nextcloud external_type: na -custom_version_command: "curl -s https://raw.githubusercontent.com/nextcloud/nextcloud.com/master/strings.php | awk -F\\\\' '/VERSIONS_SERVER_FULL_STABLE/ {print $2;exit}'" +custom_version_command: "curl -sX GET https://api.github.com/repos/nextcloud/server/releases/latest | jq -r '. | .tag_name' | sed 's|^v||'" release_type: stable release_tag: latest ls_branch: master diff --git a/readme-vars.yml b/readme-vars.yml index d8a0703..87bfb20 100644 --- a/readme-vars.yml +++ b/readme-vars.yml @@ -78,6 +78,7 @@ app_setup_block: | # changelog changelogs: + - { date: "21.05.22:", desc: "Update version check endpoint." } - { date: "28.04.22:", desc: "Increase OPCache interned strings buffered setting to 16." } - { date: "14.04.22:", desc: "Nginx default site config updated for v23 (existing users should delete `/config/nginx/site-confs/default` and restart the container). Fix LDAP connection." } - { date: "11.09.21:", desc: "Rebasing to alpine 3.14" }