forked from apache/commons-csv
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbridge_incremental.sh
More file actions
executable file
·64 lines (55 loc) · 2.45 KB
/
Copy pathbridge_incremental.sh
File metadata and controls
executable file
·64 lines (55 loc) · 2.45 KB
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/usr/bin/env bash
#================================================================================
# Title : bridge_incremental.sh
# Author : Didier Botella
# Version : 1.2
# Date : 2025-04-16
# Description : Make an incremental analysis with bridge
#================================================================================
COV_ANALYSIS_PATH=/Applications/cov-analysis-macos-arm-2024.12.0
# À ajouter après le source des variables
required_vars=(
"COVERITY_URL"
"COV_USER"
"COVERITY_PASSPHRASE"
"COV_ANALYSIS_PATH"
)
for var in "${required_vars[@]}"; do
if [ -z "${!var}" ]; then
echo "Error: $var is not set"
exit 1
fi
done
export BRIDGE_PATH=bridge
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
BRIDGE_PATH=bridge-cli-bundle-linux64
[[ -f "$BRIDGE_PATH".zip ]] || wget "https://repo.blackduck.com/bds-integrations-release/com/blackduck/integration/bridge/binaries/bridge-cli-bundle/latest/bridge-cli-bundle-linux64.zip"
[[ -d "$BRIDGE_PATH" ]] || unzip ./"$BRIDGE_PATH".zip
export PATH=$PATH:$BRIDGE_PATH
fi
if [[ "$OSTYPE" == "darwin"* ]]; then
if [[ "$(uname -m)" == "arm64" ]]; then
BRIDGE_PATH=bridge-cli-bundle-macos_arm
[[ -f "$BRIDGE_PATH".zip ]] || wget "https://repo.blackduck.com/bds-integrations-release/com/blackduck/integration/bridge/binaries/bridge-cli-bundle/latest/bridge-cli-bundle-macos_arm.zip"
[[ -d "$BRIDGE_PATH" ]] || unzip ./"$BRIDGE_PATH".zip
export PATH=$PATH:$BRIDGE_PATH
else
BRIDGE_PATH=bridge-cli-bundle-macos
[[ -f "$BRIDGE_PATH".zip ]] || wget "https://repo.blackduck.com/bds-integrations-release/com/blackduck/integration/bridge/binaries/bridge-cli-bundle/latest/bridge-cli-bundle-macosx.zip"
[[ -d "$BRIDGE_PATH" ]] || unzip ./"$BRIDGE_PATH".zip
export PATH=$PATH:$BRIDGE_PATH
fi
fi
export BRIDGE_COVERITY_CONNECT_USER_NAME="$COV_USER"
export BRIDGE_COVERITY_CONNECT_USER_PASSWORD="$COVERITY_PASSPHRASE"
export COVERITY_PROJECT=commons-csv
export COVERITY_STREAM=commons-csv-bridge
export COVERITY_VIEW_NAME="(Global) Non Legacy Issues"
bridge-cli --stage connect \
coverity.connect.url="$COVERITY_URL" \
coverity.connect.project.name="$COVERITY_PROJECT" \
coverity.connect.stream.name="$COVERITY_STREAM" \
coverity.connect.policy.view="$COVERITY_VIEW_NAME" \
coverity.install.directory="$COV_ANALYSIS_PATH" \
coverity.automation.prcomment="true" \
coverity.local=true