diff --git a/Jenkinsfile b/Jenkinsfile index 5ab4e13..240c087 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -24,6 +24,9 @@ pipeline { DEV_DOCKERHUB_IMAGE = 'lsiodev/openssh-server' PR_DOCKERHUB_IMAGE = 'lspipepr/openssh-server' DIST_IMAGE = 'alpine' + DIST_TAG = '3.13' + DIST_REPO = 'http://nl.alpinelinux.org/alpine/v3.13/main/' + DIST_REPO_PACKAGES = 'openssh-server' MULTIARCH='true' CI='true' CI_WEB='false' @@ -98,14 +101,15 @@ pipeline { /* ######################## External Release Tagging ######################## */ - // If this is a custom command to determine version use that command - stage("Set tag custom bash"){ + // If this is an alpine repo change for external version determine an md5 from the version string + stage("Set tag Alpine Repo"){ steps{ script{ env.EXT_RELEASE = sh( - script: ''' curl -s http://dl-cdn.alpinelinux.org/alpine/v3.13/main/x86_64/ |awk -F '(openssh-server-|.apk)' '/openssh-server.*.apk/ {print $2; exit}' ''', + script: '''curl -sL "${DIST_REPO}x86_64/APKINDEX.tar.gz" | tar -xz -C /tmp \ + && awk '/^P:'"${DIST_REPO_PACKAGES}"'$/,/V:/' /tmp/APKINDEX | sed -n 2p | sed 's/^V://' ''', returnStdout: true).trim() - env.RELEASE_LINK = 'custom_command' + env.RELEASE_LINK = 'alpine_repo' } } } @@ -736,11 +740,11 @@ pipeline { "tagger": {"name": "LinuxServer Jenkins","email": "jenkins@linuxserver.io","date": "'${GITHUB_DATE}'"}}' ''' echo "Pushing New release for Tag" sh '''#! /bin/bash - echo "Updating to ${EXT_RELEASE_CLEAN}" > releasebody.json + echo "Updating external repo packages to ${EXT_RELEASE_CLEAN}" > releasebody.json echo '{"tag_name":"'${META_TAG}'",\ "target_commitish": "master",\ "name": "'${META_TAG}'",\ - "body": "**LinuxServer Changes:**\\n\\n'${LS_RELEASE_NOTES}'\\n**Remote Changes:**\\n\\n' > start + "body": "**LinuxServer Changes:**\\n\\n'${LS_RELEASE_NOTES}'\\n**Repo Changes:**\\n\\n' > start printf '","draft": false,"prerelease": false}' >> releasebody.json paste -d'\\0' start releasebody.json > releasebody.json.done curl -H "Authorization: token ${GITHUB_TOKEN}" -X POST https://api.github.com/repos/${LS_USER}/${LS_REPO}/releases -d @releasebody.json.done'''