diff --git a/roles/generate-jenkins/templates/Jenkinsfile.j2 b/roles/generate-jenkins/templates/Jenkinsfile.j2 index 257cd419..6646daae 100644 --- a/roles/generate-jenkins/templates/Jenkinsfile.j2 +++ b/roles/generate-jenkins/templates/Jenkinsfile.j2 @@ -85,6 +85,19 @@ pipeline { /* ######################## External Release Tagging ######################## */ +{% if custom_version_command is defined %} + // If this is a custom command to determine version use that command + stage("Set tag custom bash"){ + steps{ + script{ + env.EXT_RELEASE = sh( + script: ''' {{ custom_version_command }} ''', + returnStdout: true).trim() + env.RELEASE_LINK = 'custom_command' + } + } + } +{% endif %} {% if external_type == "github_devel" %} // If this is a devel github release use the first in an array from github to determine the ext tag stage("Set ENV github_devel"){ @@ -677,6 +690,9 @@ pipeline { "tagger": {"name": "LinuxServer Jenkins","email": "jenkins@linuxserver.io","date": "'${GITHUB_DATE}'"}}' ''' echo "Pushing New release for Tag" sh '''#! /bin/bash +{% if custom_version_command is defined %} + echo "Updating to ${EXT_RELEASE}" > releasebody.json +{% endif %} {% if external_type == "github_devel" %} curl -s https://api.github.com/repos/${EXT_USER}/${EXT_REPO}/releases/latest | jq '. |.body' | sed 's:^.\\(.*\\).$:\\1:' > releasebody.json {% elif external_type == "github_stable" %} @@ -703,6 +719,9 @@ pipeline { echo '{"tag_name":"'${EXT_RELEASE}'-pkg-'${PACKAGE_TAG}'-ls'${LS_TAG_NUMBER}'",\ "target_commitish": "{{ ls_branch }}",\ "name": "'${EXT_RELEASE}'-pkg-'${PACKAGE_TAG}'-ls'${LS_TAG_NUMBER}'",\ +{% if custom_version_command is defined %} + "body": "**LinuxServer Changes:**\\n\\n'${LS_RELEASE_NOTES}'\\n**Remote Changes:**\\n\\n' > start +{% endif %} {% if external_type == "github_devel" %} "body": "**LinuxServer Changes:**\\n\\n'${LS_RELEASE_NOTES}'\\n**'${EXT_REPO}' Changes:**\\n\\n' > start {% elif external_type == "github_stable" %}