JqParseJfrogCliConf

nicolaw 1st July 2019 at 11:19am
Artifactory jq json Xray
eval "$(jq -r '.artifactory[]|select(.isDefault == true)|
  {"user":.user,"password":.password,"apiurl":.url|
  gsub("artifactory";"xray")|gsub("/[^/]+/$";"")}|
  to_entries|map("declare \(.key)=\(.value|tostring|@sh)")|.[]' \
  ~/.jfrog/jfrog-cli.conf)"

echo "user=$user"
echo "password=$password"
echo "apiurl=$apiurl"

Related

https://jfrog.com/blog/fully-reproducible-builds-with-circleci-and-artifactory/