wrappers:
- workspace-cleanup
- timestamps
- - ansicolor
+ - ansicolor:
+ colormap: xterm
scm:
- git:
- origin/{version}
triggers:
- - pollscm: "@hourly"
+ - pollscm:
+ cron: "@hourly"
properties:
- github:
- warnings:
console-log-parsers:
- 'GNU Make + GNU C Compiler (gcc)'
- total-thresholds:
+ #total-thresholds:
#failed:
# total-all: 0
# total-high: 0
defaults: liburcu
triggers:
- - pollscm: "@daily"
+ - pollscm:
+ cron: "@daily"
builders:
- shell: |
node: 'x86-64'
triggers:
- - pollscm: "@daily"
+ - pollscm:
+ cron: "@daily"
builders:
- shell:
dir: 'scan-build-archive/'
files: 'index.html'
-# TODO: liburcu_{version}_coverity
+- job-template:
+ name: liburcu_{version}_coverity
+ defaults: liburcu
+ node: 'x86-64'
+
+ triggers:
+ - pollscm:
+ cron: "@daily"
+
+ wrappers:
+ - workspace-cleanup
+ - timestamps
+ - ansicolor:
+ colormap: xterm
+ - credentials-binding:
+ - username-password-separated:
+ credential-id: liburcu_coverity_token
+ username: COVERITY_SCAN_PROJECT_NAME
+ password: COVERITY_SCAN_TOKEN
+
+ builders:
+ - shell:
+ !include-raw-escape scripts/common/coverity.sh
+
+ publishers:
+ - workspace-cleanup
## Project
build: !!python/tuple [std]
- 'liburcu_{version}_cppcheck'
- 'liburcu_{version}_scan-build'
+ - 'liburcu_{version}_coverity':
+ version: master
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# Coverity settings
+# The project name and token have to be provided trough env variables
#COVERITY_SCAN_PROJECT_NAME=""
#COVERITY_SCAN_TOKEN=""
COVERITY_SCAN_VERSION=`git describe --always | sed 's|-|.|g'`
# Verify upload is permitted
+set +x
AUTH_RES=`curl -s --form project="$COVERITY_SCAN_PROJECT_NAME" --form token="$COVERITY_SCAN_TOKEN" $SCAN_URL/api/upload_permitted`
+set -x
if [ "$AUTH_RES" = "Access denied" ]; then
echo -e "\033[33;1mCoverity Scan API access denied. Check COVERITY_SCAN_PROJECT_NAME and COVERITY_SCAN_TOKEN.\033[0m"
exit 1
if [ ! -d $TOOL_BASE ]; then
if [ ! -e $TOOL_ARCHIVE ]; then
echo -e "\033[33;1mDownloading Coverity Scan Analysis Tool...\033[0m"
+ set +x
wget -nv -O $TOOL_ARCHIVE $TOOL_URL --post-data "project=$COVERITY_SCAN_PROJECT_NAME&token=$COVERITY_SCAN_TOKEN"
+ set -x
fi
# Extract Coverity Scan Analysis Tool
# Upload results
echo -e "\033[33;1mUploading Coverity Scan Analysis results...\033[0m"
+set +x
response=$(curl \
--silent --write-out "\n%{http_code}\n" \
--form project=$COVERITY_SCAN_PROJECT_NAME \
--form version=$COVERITY_SCAN_VERSION \
--form description=$COVERITY_SCAN_DESCRIPTION \
$UPLOAD_URL)
+set -x
status_code=$(echo "$response" | sed -n '$p')
if [ "$status_code" != "201" ]; then
TEXT=$(echo "$response" | sed '$d')