blob: 33d4fa5a68c73ac5984fe2f01899277c48d03bda [file] [log] [blame]
Neels Hofmeyra7e09872016-10-01 01:34:41 +02001#!/usr/bin/env bash
2
3set -e -x
4
5base_dir="$PWD"
6src_dir="$base_dir/source-Osmocom"
7cov_dir="$src_dir/cov-int"
8
Neels Hofmeyr6fbe3aa2016-10-11 14:05:25 +02009rm -rf "$src_dir"
10./prepare_source_Osmcocom.sh
11
Neels Hofmeyra7e09872016-10-01 01:34:41 +020012export PATH="$base_dir/cov-analysis-linux64-8.5.0/bin/:$PATH"
13
14rm -rf "$cov_dir"
15cov-build --dir "$cov_dir" ./build_Osmocom.sh
16
17cd "$src_dir"
18rm -f Osmocom.tgz
19tar czf Osmocom.tgz cov-int
20
Neels Hofmeyr7c274bc2016-10-01 02:08:36 +020021# Don't leak the token to jenkins build logs, but still log the call:
22# First compose the call to echo, then run with token inserted by 'eval'.
23set +x
24
25curl_cmd='curl \
26 --form token="$token" \
27 --form email=holger@freyther.de --form file=@Osmocom.tgz \
28 --form version=Version --form description=AutoUpload \
29 https://scan.coverity.com/builds?project=Osmocom'
30echo "$curl_cmd"
31
32token="$($base_dir/get_token.sh $base_dir/tokens.txt Osmocom)"
33if [ -z "$token" ]; then
34 echo "TOKEN IS EMPTY"
35 exit 1
36fi
37
38eval "$curl_cmd"