From b8c7d631e8800b100c9772b587165e5c423d168e Mon Sep 17 00:00:00 2001 From: TheSpad Date: Sun, 7 Jan 2024 16:16:30 +0000 Subject: [PATCH 1/2] Bump to 6.2.12 --- Dockerfile | 8 ++++---- Dockerfile.aarch64 | 8 ++++---- readme-vars.yml | 1 + 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index 486ba9d..1a1896f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,9 @@ # syntax=docker/dockerfile:1 -FROM ghcr.io/linuxserver/baseimage-alpine:3.18 as alpine-buildstage +FROM ghcr.io/linuxserver/baseimage-alpine:3.19 as alpine-buildstage # set version label -ARG UNRAR_VERSION=6.2.10 +ARG UNRAR_VERSION=6.2.12 RUN \ echo "**** install build dependencies ****" && \ @@ -32,7 +32,7 @@ RUN \ FROM ghcr.io/linuxserver/baseimage-ubuntu:jammy as ubuntu-buildstage # set version label -ARG UNRAR_VERSION=6.2.10 +ARG UNRAR_VERSION=6.2.12 RUN \ echo "**** install build dependencies ****" && \ @@ -44,7 +44,7 @@ RUN \ mkdir /tmp/unrar && \ curl -o \ /tmp/unrar.tar.gz -L \ - "https://www.rarlab.com/rar/unrarsrc-${UNRAR_VERSION}.tar.gz" && \ + "https://www.rarlab.com/rar/unrarsrc-${UNRAR_VERSION}.tar.gz" && \ tar xf \ /tmp/unrar.tar.gz -C \ /tmp/unrar --strip-components=1 && \ diff --git a/Dockerfile.aarch64 b/Dockerfile.aarch64 index 4b1718a..6da0a40 100644 --- a/Dockerfile.aarch64 +++ b/Dockerfile.aarch64 @@ -1,9 +1,9 @@ # syntax=docker/dockerfile:1 -FROM ghcr.io/linuxserver/baseimage-alpine:arm64v8-3.18 as alpine-buildstage +FROM ghcr.io/linuxserver/baseimage-alpine:arm64v8-3.19 as alpine-buildstage # set version label -ARG UNRAR_VERSION=6.2.10 +ARG UNRAR_VERSION=6.2.12 RUN \ echo "**** install build dependencies ****" && \ @@ -32,7 +32,7 @@ RUN \ FROM ghcr.io/linuxserver/baseimage-ubuntu:arm64v8-jammy as ubuntu-buildstage # set version label -ARG UNRAR_VERSION=6.2.10 +ARG UNRAR_VERSION=6.2.12 RUN \ echo "**** install build dependencies ****" && \ @@ -43,7 +43,7 @@ RUN \ mkdir /tmp/unrar && \ curl -o \ /tmp/unrar.tar.gz -L \ - "https://www.rarlab.com/rar/unrarsrc-${UNRAR_VERSION}.tar.gz" && \ + "https://www.rarlab.com/rar/unrarsrc-${UNRAR_VERSION}.tar.gz" && \ tar xf \ /tmp/unrar.tar.gz -C \ /tmp/unrar --strip-components=1 && \ diff --git a/readme-vars.yml b/readme-vars.yml index f286328..ddc46ca 100644 --- a/readme-vars.yml +++ b/readme-vars.yml @@ -51,4 +51,5 @@ full_custom_readme: | ## Versions + * **07.01.24:** - Bump to 6.2.12. * **11.08.23:** - Initial release. From 834742ecec1fc0d30c311c0a4c386018a6961f5a Mon Sep 17 00:00:00 2001 From: TheSpad Date: Sun, 7 Jan 2024 16:50:31 +0000 Subject: [PATCH 2/2] Update jenkins vars and run builder --- .github/workflows/external_trigger.yml | 2 +- Jenkinsfile | 79 ++++++++++++++------------ README.md | 6 +- jenkins-vars.yml | 2 +- 4 files changed, 47 insertions(+), 42 deletions(-) diff --git a/.github/workflows/external_trigger.yml b/.github/workflows/external_trigger.yml index 50408f0..2ab313e 100644 --- a/.github/workflows/external_trigger.yml +++ b/.github/workflows/external_trigger.yml @@ -20,7 +20,7 @@ jobs: echo "**** External trigger running off of main branch. To disable this trigger, set a Github secret named \"PAUSE_EXTERNAL_TRIGGER_UNRAR_MAIN\". ****" echo "External trigger running off of main branch. To disable this trigger, set a Github secret named \`PAUSE_EXTERNAL_TRIGGER_UNRAR_MAIN\`" >> $GITHUB_STEP_SUMMARY echo "**** Retrieving external version ****" - EXT_RELEASE=$(echo 6.2.10) + EXT_RELEASE=$(echo 6.2.12) if [ -z "${EXT_RELEASE}" ] || [ "${EXT_RELEASE}" == "null" ]; then echo "**** Can't retrieve external version, exiting ****" FAILURE_REASON="Can't retrieve external version for unrar branch main" diff --git a/Jenkinsfile b/Jenkinsfile index 81f6673..2539bd3 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -16,7 +16,6 @@ pipeline { GITHUB_TOKEN=credentials('498b4638-2d02-4ce5-832d-8a57d01d97ab') GITLAB_TOKEN=credentials('b6f0f1dd-6952-4cf6-95d1-9c06380283f0') GITLAB_NAMESPACE=credentials('gitlab-namespace-id') - SCARF_TOKEN=credentials('scarf_api_key') BUILD_VERSION_ARG = 'UNRAR_VERSION' LS_USER = 'linuxserver' LS_REPO = 'docker-unrar' @@ -110,7 +109,7 @@ pipeline { steps{ script{ env.EXT_RELEASE = sh( - script: ''' echo 6.2.10 ''', + script: ''' echo 6.2.12 ''', returnStdout: true).trim() env.RELEASE_LINK = 'custom_command' } @@ -329,12 +328,12 @@ pipeline { else echo "false" > /tmp/${COMMIT_SHA}-${BUILD_NUMBER} fi - mkdir -p ${TEMPDIR}/gitbook - git clone https://github.com/linuxserver/docker-documentation.git ${TEMPDIR}/gitbook/docker-documentation - if [[ ("${BRANCH_NAME}" == "master") || ("${BRANCH_NAME}" == "main") ]] && [[ (! -f ${TEMPDIR}/gitbook/docker-documentation/images/docker-${CONTAINER_NAME}.md) || ("$(md5sum ${TEMPDIR}/gitbook/docker-documentation/images/docker-${CONTAINER_NAME}.md | awk '{ print $1 }')" != "$(md5sum ${TEMPDIR}/docker-${CONTAINER_NAME}/.jenkins-external/docker-${CONTAINER_NAME}.md | awk '{ print $1 }')") ]]; then - cp ${TEMPDIR}/docker-${CONTAINER_NAME}/.jenkins-external/docker-${CONTAINER_NAME}.md ${TEMPDIR}/gitbook/docker-documentation/images/ - cd ${TEMPDIR}/gitbook/docker-documentation/ - git add images/docker-${CONTAINER_NAME}.md + mkdir -p ${TEMPDIR}/docs + git clone https://github.com/linuxserver/docker-documentation.git ${TEMPDIR}/docs/docker-documentation + if [[ ("${BRANCH_NAME}" == "master") || ("${BRANCH_NAME}" == "main") ]] && [[ (! -f ${TEMPDIR}/docs/docker-documentation/docs/images/docker-${CONTAINER_NAME}.md) || ("$(md5sum ${TEMPDIR}/docs/docker-documentation/docs/images/docker-${CONTAINER_NAME}.md | awk '{ print $1 }')" != "$(md5sum ${TEMPDIR}/docker-${CONTAINER_NAME}/.jenkins-external/docker-${CONTAINER_NAME}.md | awk '{ print $1 }')") ]]; then + cp ${TEMPDIR}/docker-${CONTAINER_NAME}/.jenkins-external/docker-${CONTAINER_NAME}.md ${TEMPDIR}/docs/docker-documentation/docs/images/ + cd ${TEMPDIR}/docs/docker-documentation + git add docs/images/docker-${CONTAINER_NAME}.md git commit -m 'Bot Updating Documentation' git push https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/linuxserver/docker-documentation.git --all fi @@ -402,35 +401,6 @@ pipeline { "visibility":"public"}' ''' } } - /* ####################### - Scarf.sh package registry - ####################### */ - // Add package to Scarf.sh and set permissions - stage("Scarf.sh package registry"){ - when { - branch "main" - environment name: 'EXIT_STATUS', value: '' - } - steps{ - sh '''#! /bin/bash - PACKAGE_UUID=$(curl -X GET -H "Authorization: Bearer ${SCARF_TOKEN}" https://scarf.sh/api/v1/organizations/linuxserver-ci/packages | jq -r '.[] | select(.name=="linuxserver/unrar") | .uuid' || :) - if [ -z "${PACKAGE_UUID}" ]; then - echo "Adding package to Scarf.sh" - curl -sX POST https://scarf.sh/api/v1/organizations/linuxserver-ci/packages \ - -H "Authorization: Bearer ${SCARF_TOKEN}" \ - -H "Content-Type: application/json" \ - -d '{"name":"linuxserver/unrar",\ - "shortDescription":"example description",\ - "libraryType":"docker",\ - "website":"https://github.com/linuxserver/docker-unrar",\ - "backendUrl":"https://ghcr.io/linuxserver/unrar",\ - "publicUrl":"https://lscr.io/linuxserver/unrar"}' || : - else - echo "Package already exists on Scarf.sh" - fi - ''' - } - } /* ############### Build Container ############### */ @@ -747,6 +717,41 @@ pipeline { curl -H "Authorization: token ${GITHUB_TOKEN}" -X POST https://api.github.com/repos/${LS_USER}/${LS_REPO}/releases -d @releasebody.json.done''' } } + // Add protection to the release branch + stage('Github-Release-Branch-Protection') { + when { + branch "main" + environment name: 'CHANGE_ID', value: '' + environment name: 'EXIT_STATUS', value: '' + } + steps { + echo "Setting up protection for release branch main" + sh '''#! /bin/bash + curl -H "Authorization: token ${GITHUB_TOKEN}" -X PUT https://api.github.com/repos/${LS_USER}/${LS_REPO}/branches/main/protection \ + -d $(jq -c . << EOF + { + "required_status_checks": null, + "enforce_admins": false, + "required_pull_request_reviews": { + "dismiss_stale_reviews": false, + "require_code_owner_reviews": false, + "require_last_push_approval": false, + "required_approving_review_count": 1 + }, + "restrictions": null, + "required_linear_history": false, + "allow_force_pushes": false, + "allow_deletions": false, + "block_creations": false, + "required_conversation_resolution": true, + "lock_branch": false, + "allow_fork_syncing": false, + "required_signatures": false + } +EOF + ) ''' + } + } // Use helper container to sync the current README on master to the dockerhub endpoint stage('Sync-README') { when { diff --git a/README.md b/README.md index 61b2e78..dbfa50c 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,5 @@ - - - + + [![linuxserver.io](https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/linuxserver_medium.png)](https://linuxserver.io) [![Blog](https://img.shields.io/static/v1.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=linuxserver.io&message=Blog)](https://blog.linuxserver.io "all the things you can do with our containers including How-To guides, opinions and much more!") @@ -49,4 +48,5 @@ The currently included binaries are as follows: ## Versions +* **07.01.24:** - Bump to 6.2.12. * **11.08.23:** - Initial release. diff --git a/jenkins-vars.yml b/jenkins-vars.yml index 9798a7f..5af32c0 100644 --- a/jenkins-vars.yml +++ b/jenkins-vars.yml @@ -3,7 +3,7 @@ # jenkins variables project_name: docker-unrar external_type: na -custom_version_command: "echo 6.2.10" +custom_version_command: "echo 6.2.12" release_type: stable release_tag: latest ls_branch: main