HBASE-12347 Improve the logic for checking JIRA status
This commit is contained in:
parent
f641aada36
commit
04cb138142
|
@ -72,17 +72,15 @@ function get_jira_status {
|
||||||
# span id="resolution-val" class="value resolved" >
|
# span id="resolution-val" class="value resolved" >
|
||||||
# The following is a bit brittle, but filters for lines with
|
# The following is a bit brittle, but filters for lines with
|
||||||
# resolution-val returns 99 if it's resolved
|
# resolution-val returns 99 if it's resolved
|
||||||
jira_url='https://issues.apache.org/jira/browse'
|
jira_url='https://issues.apache.org/jira/rest/api/2/issue'
|
||||||
jira_id="$1"
|
jira_id="$1"
|
||||||
status="$(curl -s $jira_url/$jira_id | \
|
curl -s "$jira_url/$jira_id?fields=resolution" |grep -q '{"resolution":null}'
|
||||||
grep resolution-val | \
|
status=$?
|
||||||
sed -e "s/.*class=\"value\ //" | \
|
if [ $status -ne 0 -a $status -ne 1 ]; then
|
||||||
cut -d'"' -f 1)"
|
|
||||||
if [ $? -ne 0 ]; then
|
|
||||||
echo "Could not get JIRA status. Check your network." >&2
|
echo "Could not get JIRA status. Check your network." >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
if [ "$status" = "resolved" ]; then
|
if [ $status -ne 0 ]; then
|
||||||
return 99
|
return 99
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue