Unable to use the grep -ivr command in Gocd shell script executor plugin

6 views
Skip to first unread message

priya shetty

unread,
Nov 30, 2022, 2:12:50 AM11/30/22
to go-cd
Hello,

Cannot we use the grep -ivr command in the gocd pipeline script executor plugin?

I am using the following aws cli command with the grep command and unable to use it.

aws iam list-policies | jq '.Policies[]   | .Arn' | grep -ivr "test" | cut -d '"' -f 2  > test.csv

Instead of filtering the aws cli output , it writes the complete git log to the csv file

Is there any restriction on using the grep command in the Gocd shell script executor plugin ?

Thanks
Regards

Chad Wilson

unread,
Nov 30, 2022, 2:31:50 AM11/30/22
to go...@googlegroups.com
The command runs on your agent, with the tools (bash, grep etc) available to your specific agent type and its OS.

You might want to first check if it runs as you'd expect on the specific agent type directly (via ssh or docker run or similar).

If it works when run directly, perhaps the issue is with the input to the shell executor and your GoCD configuration.

If you still can't get it to work, you might want to think about source controlling the script for easier maintenance.

-Chad

--
You received this message because you are subscribed to the Google Groups "go-cd" group.
To unsubscribe from this group and stop receiving emails from it, send an email to go-cd+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/go-cd/1b9bf2ba-5bb9-4ac0-ad6d-df35051b120bn%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages