Skip to content

Commit

Permalink
Merge pull request #4 from thelamer/master
Browse files Browse the repository at this point in the history
adding a custom bash command to the jenkinsfile if it is defined
  • Loading branch information
aptalca authored Dec 20, 2018
2 parents d7c869e + ff50b42 commit 856d5e2
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions roles/generate-jenkins/templates/Jenkinsfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -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"){
Expand Down Expand Up @@ -677,6 +690,9 @@ pipeline {
"tagger": {"name": "LinuxServer Jenkins","email": "[email protected]","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" %}
Expand All @@ -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" %}
Expand Down

0 comments on commit 856d5e2

Please sign in to comment.