forked from acts-project/acts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcheck_doxygen
executable file
·34 lines (29 loc) · 1.12 KB
/
check_doxygen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#! /usr/bin/env bash
# abort on error
set -ex
# check for correct number of arguments
if [ $# -ne 1 ]
then
echo "wrong number of arguments"
echo "usage: check_doxygen <doxygen_log_file>"
exit 1
fi
# check for required environment variables
: ${gitlabToken:?"'gitlabToken' not set or empty"}
: ${gitlabTargetNamespace:?"'gitlabTargetNamespace' not set or empty"}
: ${gitlabTargetRepoName:?"'gitlabTargetRepoName' not set or empty"}
: ${gitlabMergeRequestId:?"'gitlabMergeRequestId' not set or empty"}
: ${BUILD_URL:?"'BUILD_URL' not set or empty"}
# parse doxygen logfile
DOXY_LOG=$1
ARTEFACT=$(basename $DOXY_LOG)
if [ -e $DOXY_LOG ]
then
WARNINGS=`grep -i warning $DOXY_LOG | wc -l`
ERRORS=`grep -i error $DOXY_LOG | wc -l`
COMMENT="doxygen output:<br />$ERRORS errors<br />$WARNINGS warnings<br />full doxygen output can be found [here]($BUILD_URL/artifact/$ARTEFACT)"
else
COMMENT="<b>FATAL</b>: no logfile from doxygen found"
fi
# publish result as comment
./comment_merge_request add "$COMMENT" --project $gitlabTargetNamespace/$gitlabTargetRepoName --merge-request-id $gitlabMergeRequestId --token $gitlabToken