File tree Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change 22
33# Check for install/updates at https://github.com/bearer/bearer
44
5+ # For this script to work, you need to change the permissions on the results/ directory to 777
6+ # so docker can write the results file into the results/ folder
7+
58source scripts/requireCommand.sh
69
710requireCommand docker
@@ -10,6 +13,17 @@ docker pull bearer/bearer --platform linux/amd64
1013
1114benchmark_version=$( scripts/getBenchmarkVersion.sh)
1215bearer_version=$( docker run --platform linux/amd64 bearer/bearer bearer --version | grep -o ' [[:digit:]]\+\.[[:digit:]]\+\.[[:digit:]]\+' )
13- result_file=" /src/results/Benchmark_$benchmark_version -Bearer-v$bearer_version .json"
16+ result_file=" results/Benchmark_$benchmark_version -Bearer-v$bearer_version .json"
17+ temp_result_file=" $result_file .tmp"
18+ docker_result_file=" /benchmark/$temp_result_file "
19+
20+ # if you set the Docker userid to match the current user id with: --user $(id -u):$(id -g) you get a suspicious git repository error
21+ docker run --platform linux/amd64 --rm -v " ${PWD} :/benchmark" bearer/bearer scan /benchmark/src/main/ --format jsonv2 --output " $docker_result_file " > /dev/null
22+
23+ # Because the docker userid and current user ID might be different, we write the Bearer result to a temp file.
24+ # Then copy it to the desired file name, and then delete the temp file.
25+ #
26+ # We can't just chown the file to the right user ID as Unix won't allow that.
27+ cp $temp_result_file $result_file
28+ rm -f $temp_result_file
1429
15- docker run --platform linux/amd64 --rm -v " ${PWD} :/src" bearer/bearer scan /src/src/main/ --format jsonv2 --output " $result_file " > /dev/null
You can’t perform that action at this time.
0 commit comments