Move gerrit comment logic to its own file
[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
6 # If no violations were found, no lint log will exist.
7 if [[ -e securityaudit.log ]] ; then
8     echo -e "\nposting security audit report to gerrit...\n"
9
10     cat securityaudit.log  | awk -F"ERROR\ \-\ " '{print $2}' > shortlog
11
12     ssh -p 29418 gerrit.opnfv.org \
13         "gerrit review -p $GERRIT_PROJECT \
14          -m \"$(cat shortlog)\" \
15          $GERRIT_PATCHSET_REVISION \
16          --notify NONE"
17
18     exit 1
19 fi