groovy-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From CFouts <chrisfo...@ziftsolutions.com>
Subject Re: handling shell pipelines in Jenkins 2.164.3
Date Mon, 17 Feb 2020 16:21:00 GMT
The clearmake command is a shell command too correct? Try this syntax

 

sh “””

   your commands here
“””

 

You will have to escape at least the the “$” symbols.

 

Chris

 

From: Dimitar Vassilev <dimitar.vassilev@gmail.com>
Reply-To: <users@groovy.apache.org>
Date: Monday, February 17, 2020 at 11:13 AM
To: <users@groovy.apache.org>
Subject: handling shell pipelines in Jenkins 2.164.3

 

Greeting fellows,

 

can anyone point me how to handle shell pipelines in Jenkins 2.164.3

I'm having a problem with the following sample code

 

stage('inject full build'){
  steps{
    script {
      sh "#!/usr/bin/env bash \n" +
         "clearmake setview -exec 'clearmake -k full' ${VIEW} | awk -F '<|>' 'NR ==2
{ print $2 } ' > foo.txt"
             }
          }
     }

The objective is to record the build id injected into the build queue and monitor the build
status later with LSF bjobs command options. when I put the above syntax I get an error message
like 

 

unexpected syntax error near unexpected token `|`

 

Any pointers will be appreciated.

Best regards,

 

Dimitar 


Mime
View raw message