-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Expand file tree
/
Copy pathdocker-shell.sh
More file actions
executable file
·37 lines (29 loc) · 1.16 KB
/
docker-shell.sh
File metadata and controls
executable file
·37 lines (29 loc) · 1.16 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
#!/usr/bin/env bash
set -euo pipefail
VERSION="$(mvn help:evaluate -q --non-recursive -DforceStdout -Dexpression=project.version)"
OWASPDC_DIRECTORY=$HOME/OWASP-Dependency-Check
DATA_DIRECTORY="$OWASPDC_DIRECTORY/data"
REPORT_DIRECTORY="$OWASPDC_DIRECTORY/reports"
CACHE_DIRECTORY="$OWASPDC_DIRECTORY/data/cache"
if [ ! -d "$DATA_DIRECTORY" ]; then
echo "Initially creating persistent directory: $DATA_DIRECTORY"
mkdir -p "$DATA_DIRECTORY"
fi
if [ ! -d "$REPORT_DIRECTORY" ]; then
echo "Initially creating persistent directory: $REPORT_DIRECTORY"
mkdir -p "$REPORT_DIRECTORY"
fi
if [ ! -d "$CACHE_DIRECTORY" ]; then
echo "Initially creating persistent directory: $CACHE_DIRECTORY"
mkdir -p "$CACHE_DIRECTORY"
fi
if [ -f "$HOME/OWASP-Dependency-Check/reports/dependency-check-report.json" ]; then
rm "$HOME/OWASP-Dependency-Check/reports/dependency-check-report.json"
fi
# Make sure we are using the latest version
# docker pull owasp/dependency-check
docker run -it --rm \
--volume "$DATA_DIRECTORY":/usr/share/dependency-check/data \
--volume "$REPORT_DIRECTORY":/report \
--entrypoint /bin/sh \
owasp/dependency-check:$VERSION