Merge "Push Functest API doc to artifact"
[releng.git] / jjb / ci_gate_security / anteater-security-audit-weekly.sh
1 #!/bin/bash
2 # SPDX-license-identifier: Apache-2.0
3
4 echo "--------------------------------------------------------"
5 vols="-v $WORKSPACE/allrepos/:/home/opnfv/anteater/allrepos/"
6 echo "Pulling releng-anteater docker image"
7 echo "--------------------------------------------------------"
8 docker pull opnfv/releng-anteater
9 echo "--------------------------------------------------------"
10 cmd="docker run -id $vols opnfv/releng-anteater /bin/bash"
11 echo "Running docker command $cmd"
12 container_id=$($cmd)
13 echo "Container ID is $container_id"
14 source $WORKSPACE/opnfv-projects.sh
15 for project in "${PROJECT_LIST[@]}"
16
17 do
18   cmd="anteater --project testproj --path /home/opnfv/anteater/allrepos/$project"
19   echo "Executing command inside container"
20   echo "$cmd"
21   echo "--------------------------------------------------------"
22   docker exec $container_id $cmd > $WORKSPACE/"$project".securityaudit.log 2>&1
23 done
24
25 exit_code=$?
26 echo "--------------------------------------------------------"
27 echo "Stopping docker container with ID $container_id"
28 docker stop $container_id
29
30
31 #gsutil cp $WORKSPACE/securityaudit.log \
32 #    gs://$GS_URL/$PROJECT-securityaudit-weekly.log 2>&1
33 #
34 #gsutil -m setmeta \
35 #    -h "Content-Type:text/html" \
36 #    -h "Cache-Control:private, max-age=0, no-transform" \
37 #    gs://$GS_URL/$PROJECT-securityaudit-weekly.log > /dev/null 2>&1