Merge "Reschedule armband jobs"
[releng.git] / jjb / ci_gate_security / anteater-report-to-gerrit.sh
1 #!/bin/bash
2 set -o errexit
3 set -o pipefail
4 export PATH=$PATH:/usr/local/bin/
5 EXITSTATUS=0
6
7 # If no violations were found, no lint log will exist.
8 if [[ -e securityaudit.log ]] ; then
9     echo -e "\nposting security audit report to gerrit...\n"
10
11 if grep ERROR securityaudit.log; then 
12 EXITSTATUS=1
13 fi
14
15     cat securityaudit.log  | awk -F"ERROR -\ " '{print $2}' > shortlog
16
17     ssh -p 29418 gerrit.opnfv.org \
18         "gerrit review -p $GERRIT_PROJECT \
19          -m \"$(cat shortlog)\" \
20          $GERRIT_PATCHSET_REVISION \
21          --notify NONE"
22
23     exit $EXITSTATUS
24 fi