It's because your shell command has $() around it. This will try and eval
the subshell value. You don't need the $() at all

On Sun, Aug 26, 2018, 03:44 Idan Adar <[email protected]> wrote:

> The following block fails... appreciate any insights:
>
> workerVersion = sh(script:"\$(ic cs workers ${clusterName} --json | jq -r
> .[0].kubeVersion)", returnStdout: true).trim() // This returns
> "1.9.9.1522"
> slackSend (channel: "certmgr-health", color: '#199515', message: "*$JOB_NAME*,
> <$BUILD_URL|build #$BUILD_NUMBER>: _${clusterName}'s_ worker nodes
> successfully upgraded to ${workerVersion}.")
>
> The *slackSend* never happens because the following error happens:
>
> ++ ic cs workers **** --json
> ++ jq -r '.[0].kubeVersion'
> + 1.9.9_1522
> /var/jenkins/workspace/Worker Nodes Upgrader - 
> Production@tmp/durable-1e1c34b9/script.sh: line 2: 1.9.9_1522: command not 
> found
>
> --
> 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 [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-users/714b1868-0a6e-4fd3-b131-ab7bebcaa104%40googlegroups.com
> <https://groups.google.com/d/msgid/jenkinsci-users/714b1868-0a6e-4fd3-b131-ab7bebcaa104%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> 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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/CAPiUgVfSTEntQ8qmD5LtJnQ%2BNyx5rsjuvq-1KEDxSDsfXCsfJA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to