summaryrefslogtreecommitdiffstats
path: root/travis-ci/tools/get-coverity.sh
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 13:00:47 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 13:00:47 +0000
commit2cb7e0aaedad73b076ea18c6900b0e86c5760d79 (patch)
treeda68ca54bb79f4080079bf0828acda937593a4e1 /travis-ci/tools/get-coverity.sh
parentInitial commit. (diff)
downloadsystemd-2cb7e0aaedad73b076ea18c6900b0e86c5760d79.tar.xz
systemd-2cb7e0aaedad73b076ea18c6900b0e86c5760d79.zip
Adding upstream version 247.3.upstream/247.3upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rwxr-xr-xtravis-ci/tools/get-coverity.sh35
1 files changed, 35 insertions, 0 deletions
diff --git a/travis-ci/tools/get-coverity.sh b/travis-ci/tools/get-coverity.sh
new file mode 100755
index 0000000..3634e57
--- /dev/null
+++ b/travis-ci/tools/get-coverity.sh
@@ -0,0 +1,35 @@
+#!/bin/bash
+
+# Download and extract coverity tool
+
+# Environment check
+[ -z "$COVERITY_SCAN_TOKEN" ] && echo 'ERROR: COVERITY_SCAN_TOKEN must be set' && exit 1
+
+# Use default values if not set
+PLATFORM=$(uname)
+
+TOOL_BASE=${TOOL_BASE:="/tmp/coverity-scan-analysis"}
+TOOL_ARCHIVE=${TOOL_ARCHIVE:="/tmp/cov-analysis-${PLATFORM}.tgz"}
+
+TOOL_URL="https://scan.coverity.com/download/${PLATFORM}"
+
+# Make sure wget is installed
+sudo apt-get update && sudo apt-get -y install wget
+
+# Get coverity tool
+if [ ! -d $TOOL_BASE ]; then
+ # Download Coverity Scan Analysis Tool
+ if [ ! -e $TOOL_ARCHIVE ]; then
+ echo -e "\033[33;1mDownloading Coverity Scan Analysis Tool...\033[0m"
+ wget -nv -O $TOOL_ARCHIVE $TOOL_URL --post-data "project=$COVERITY_SCAN_PROJECT_NAME&token=$COVERITY_SCAN_TOKEN"
+ fi
+
+ # Extract Coverity Scan Analysis Tool
+ echo -e "\033[33;1mExtracting Coverity Scan Analysis Tool...\033[0m"
+ mkdir -p $TOOL_BASE
+ pushd $TOOL_BASE
+ tar xzf $TOOL_ARCHIVE
+ popd
+fi
+
+echo -e "\033[33;1mCoverity Scan Analysis Tool can be found at $TOOL_BASE ...\033[0m"