[JIRA] (JENKINS-44930) Allow sh to return exit status, stdout and stderr all at once
Title: Message Title Uliul Carpatin commented on JENKINS-44930 Re: Allow sh to return exit status, stdout and stderr all at once +1 for this feature .. A solution to not break the compatibility would be to: add an extra parameter, 'returnBothOutputs' return as a list the two items [ returnStatusOptionContent , returnStdoutOptionContent ] Add Comment This message was sent by Atlassian Jira (v7.13.12#713012-sha1:6e07c38) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-issues/JIRA.183003.149756330.4149.1583856124822%40Atlassian.JIRA.
[JIRA] (JENKINS-59179) map variable replacement for keys - cannot retrieve values back
Title: Message Title Uliul Carpatin updated an issue Jenkins / JENKINS-59179 map variable replacement for keys - cannot retrieve values back Change By: Uliul Carpatin We have defined a map, with keys consisting of some predefined string which should be concatenated with the content of same variable. We use the parentheses to allow the key to be resolved with variable replacement. Printing the map, yields the correct entries for both the keys and their values.The problem is when trying to access any item in the map directly, eg: println mymap["myKey1"]. This would wrongly return null instead of the real value. Simplified sample code for a Jenkins pipeline, to reproduce the issue: — ``` node("my-node") { stage('Reproducing the issue') { MYVAR="ZZ" FIRSTELEMKAY="prefix1"+MYVAR def testmap = [("prefix1${MYVAR}"): "content1", ("prefix2${MYVAR}"): "content2"] println "[1] Reproducing the issue.." println "[1][Fine] Print map as is: " + testmap println "[1][Fine] Print map keys: " + testmap.keySet() //println "[1][Fine] Print map first key: " + testmap.keySet()[0] //println "[1][Wrong] Print the content of the first entry in the map: " + testmap[testmap.keySet()[0]] println "[1][Wrong] Print the content of the first entry in the map ($FIRSTELEMKAY): " + testmap[FIRSTELEMKAY] println "[1] The keys seem to have been populated with the expected values, BUT the find operation returns 'null' instead of the real content." }stage('WA Code'){ MYVAR="ZZ" def testmap = [("prefix1"+MYVAR): "content1", ("prefix2"+MYVAR): "content2"] println "[2] Some WA for the issue.." println "[2][Fine] Print map as is: " + testmap println "[2][Fine] Print map keys: " + testmap.keySet() //println "[2][Fine] Print map first key: " + testmap.keySet()[0] //println "[2][Fine] Print the content of the first entry in the map: " + testmap[testmap.keySet()[0]] println "[2][Fine] Print the content of the first entry in the map ($FIRSTELEMKAY): " + testmap[FIRSTELEMKAY] println "[2] The keys seem to have been populated with the expected values, the find operation returns the real content." }} — ``` Add Comment
[JIRA] (JENKINS-59179) map variable replacement for keys - cannot retrieve values back
Title: Message Title Uliul Carpatin updated an issue Jenkins / JENKINS-59179 map variable replacement for keys - cannot retrieve values back Change By: Uliul Carpatin We have defined a map, with keys consisting of some predefined string which should be concatenated with the content of same variable. We use the parentheses to allow the key to be resolved with variable replacement. Printing the map, yields the correct entries for both the keys and their values.The problem is when trying to access any item in the map directly, eg: println mymap["myKey1"]. This would wrongly return null instead of the real value. Simplified sample code for a Jenkins pipeline, to reproduce the issue:— node(" slave my - loop node ") { stage('Reproducing the issue') { MYVAR="ZZ" FIRSTELEMKAY="prefix1"+MYVAR def testmap = [("prefix1${MYVAR}"): "content1", ("prefix2${MYVAR}"): "content2"] println "[1] Reproducing the issue.." println "[1][Fine] Print map as is: " + testmap println "[1][Fine] Print map keys: " + testmap.keySet() //println "[1][Fine] Print map first key: " + testmap.keySet()[0] //println "[1][Wrong] Print the content of the first entry in the map: " + testmap[testmap.keySet()[0]] println "[1][Wrong] Print the content of the first entry in the map ($FIRSTELEMKAY): " + testmap[FIRSTELEMKAY] println "[1] The keys seem to have been populated with the expected values, BUT the find operation returns 'null' instead of the real content." }stage('WA Code'){ MYVAR="ZZ" def testmap = [("prefix1"+MYVAR): "content1", ("prefix2"+MYVAR): "content2"] println "[2] Some WA for the issue.." println "[2][Fine] Print map as is: " + testmap println "[2][Fine] Print map keys: " + testmap.keySet() //println "[2][Fine] Print map first key: " + testmap.keySet()[0] //println "[2][Fine] Print the content of the first entry in the map: " + testmap[testmap.keySet()[0]] println "[2][Fine] Print the content of the first entry in the map ($FIRSTELEMKAY): " + testmap[FIRSTELEMKAY] println "[2] The keys seem to have been populated with the expected values, the find operation returns the real content." }} — Add Comment
[JIRA] (JENKINS-59179) map variable replacement for keys - cannot retrieve values back
Title: Message Title Uliul Carpatin created an issue Jenkins / JENKINS-59179 map variable replacement for keys - cannot retrieve values back Issue Type: Bug Assignee: Unassigned Components: pipeline-build-step-plugin Created: 2019-09-02 10:44 Environment: Jenkins ver. 2.193 Pipeline-Groovy plugin: v2.74. All plugins up-to date, as of today. Priority: Major Reporter: Uliul Carpatin We have defined a map, with keys consisting of some predefined string which should be concatenated with the content of same variable. We use the parentheses to allow the key to be resolved with variable replacement. Printing the map, yields the correct entries for both the keys and their values. The problem is when trying to access any item in the map directly, eg: println mymap["myKey1"]. This would wrongly return null instead of the real value. Simplified sample code for a Jenkins pipeline, to reproduce the issue: — node("slave-loop") { stage('Reproducing the issue') { MYVAR="ZZ" FIRSTELEMKAY="prefix1"+MYVAR def testmap = [("prefix1${MYVAR}"): "content1", ("prefix2${MYVAR}"): "content2"] println "[1] Reproducing the issue.." println "[1][Fine] Print map as is: " + testmap println "[1][Fine] Print map keys: " + testmap.keySet() //println "[1][Fine] Print map first key: " + testmap.keySet()[0] //println "[1][Wrong] Print the content of the first entry in the map: " + testmap[testmap.keySet()[0]] println "[1][Wrong] Print the content of the first entry in the map ($FIRSTELEMKAY): " + testmap[FIRSTELEMKAY] println "[1] The keys seem to have been populated with the expected values, BUT the find operation returns 'null' instead of the real content." } stage('WA Code') { MYVAR="ZZ" def testmap = [("prefix1"+MYVAR): "content1", ("prefix2"+MYVAR): "content2"] println "[2] Some WA for the