Geethalakshmi Ramachandran
2017-02-16 16:23:41 UTC
A jenkins pipeline calls an API that returns metrics and prints it in the console output with formatting. However, Jenkins pipeline prints standard output for each command like below: How to disable this or turn it off?
Hide quoted text
[Pipeline] sh
[Rel _pipeline] Running shell script
def pipelineUtil=null
fileLoader.withGit('ssh://***@test:7999/test/test.git',
test,
'..,
'groovy')
{
pUtil = fileLoader.load('src/pipeline/test-utils')
}
pUtil.getTest("TEST")
test-utils.groovy
void getTest(String test) {
stage "Test"
node ('groovy')
{
sh "set +x"
mysh "curl call some api"
mysh 'echo "***********TEST************"'
mysh 'echo "Overall : "'
}
}
def mysh(cmd) {
sh('#!/bin/sh -e\n' + cmd)
}
return this;
Output :
[Pipeline] sh
[Rel _pipeline] Running shell script
***********TEST ************
[Pipeline] sh
[Rel_ pipeline] Running shell script
Overall :
Hide quoted text
[Pipeline] sh
[Rel _pipeline] Running shell script
def pipelineUtil=null
fileLoader.withGit('ssh://***@test:7999/test/test.git',
test,
'..,
'groovy')
{
pUtil = fileLoader.load('src/pipeline/test-utils')
}
pUtil.getTest("TEST")
test-utils.groovy
void getTest(String test) {
stage "Test"
node ('groovy')
{
sh "set +x"
mysh "curl call some api"
mysh 'echo "***********TEST************"'
mysh 'echo "Overall : "'
}
}
def mysh(cmd) {
sh('#!/bin/sh -e\n' + cmd)
}
return this;
Output :
[Pipeline] sh
[Rel _pipeline] Running shell script
***********TEST ************
[Pipeline] sh
[Rel_ pipeline] Running shell script
Overall :
--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-users+***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/6188bf7c-8d54-4b40-b9ac-79cc15cd3d2e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-users+***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/6188bf7c-8d54-4b40-b9ac-79cc15cd3d2e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.