-
Notifications
You must be signed in to change notification settings - Fork 105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add .prow.sh script #3
Conversation
.prow.sh
Outdated
|
||
yum -y install jq | ||
for jsonfile in *.json; do | ||
jq < $jsonfile >/dev/null |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, might be a dumb question, but do you mind elaborating a bit what does this line do?(Does it just check the validity of each json files). I was also confused about the usage of jq < $file
vs jq $file
, do you have pointers to look at for usage of <
in bash? Thanks, =)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exactly! It'll check that the JSON files are valid. Just a simple check that can be used for now until we have more sophisticated PR tests. <
means feeding the file as the program's standard input: http://tldp.org/HOWTO/Bash-Prog-Intro-HOWTO-3.html
Let's keep it simple here so that we can more easily keep our CI scripts self-contained within the repo, a-la-PAPR/Travis CI. See also openshift/os#3.
This works in tandem with the changes in openshift/release#841.
yum -y install jq | ||
for jsonfile in *.json; do | ||
echo "Checking JSON syntax for $jsonfile" | ||
jq < $jsonfile . >/dev/null |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The .
here is needed to work around a bug where jq
will refuse to work if redirecting output to something that's not a TTY: jqlang/jq#1351.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
/lgtm |
Let's keep it simple here so that we can more easily keep our CI scripts self-contained within the repo, a-la-PAPR/Travis CI. See also openshift/os#3.
This works in tandem with the changes in
openshift/release#841.