Quantcast
Channel: Active questions tagged jq - Stack Overflow
Viewing all articles
Browse latest Browse all 657

Using jq with Jenkins pipeline

$
0
0

In my use case i'm running a pipeline which calls aws cli via the withAWS plugin. I use jq to get the needed data, Now the sh returns the output as String. How do i convert this output to json object ?

withAWS(credentials: aws_env_credential){    efs_details = sh(    script: "aws efs describe-file-systems --region='${aws_region_for_cluster}' | jq --arg efs_name ${efs_name} '.[] | .[] | select(.Name==$efs_name)'",    encoding: 'UTF-8',    returnStdout: true    )  

Output:efs_details:

{"OwnerId: "2142342325","name": "my_volume","encrypted": true, ...}

here efs_details is a java.lang.String type.

Q: How do i convert this output to json so that i can use the dot operator. (example efs_details.name)


Viewing all articles
Browse latest Browse all 657

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>