Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-65564

The 'sh' action in pipeline does not correctly execute shell command

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • pipeline
    • Jenkins 2.277.4, linux

      There's probably some rational for how shell commands are passed from the pipeline sh action into the actual shell, but I've no clue what it is. I've read a lot of responses to people with similar issues, and I still can't get this command.to work...

      docker images -a | grep '<none>' | awk '{print $3}' | xargs docker rmi

      It should not be this hard. I've tried encasing in double quotes and escaping single quotes, encasing in single quotes and escaping double quotes, escaping the dollar sign, hours worth of combinations. There should be a simple 'take this string as literal, really really, as literal' syntax.

      Someone who knows how this works want to tell me how to put this command, which deletes untagged docker images, into the sh() action in a way which will actually do that?

      All help appreciated.

            Unassigned Unassigned
            dberkman David
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: