-
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from thelamer/master
adding a custom bash command to the jenkinsfile if it is defined
- Loading branch information
Showing
1 changed file
with
19 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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": "[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" %} | ||
|
@@ -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" %} | ||
|