summaryrefslogtreecommitdiffstats
path: root/jjb/ci_gate_security/anteater-security-audit-weekly.sh
blob: 11909636a23831c134caf79e5787d786690a95dc (plain)
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
#!/bin/bash
# SPDX-license-identifier: Apache-2.0

echo "--------------------------------------------------------"
vols="-v $WORKSPACE/allrepos/:/home/opnfv/anteater/allrepos/"
echo "Pulling releng-anteater docker image"
echo "--------------------------------------------------------"
docker pull opnfv/releng-anteater
echo "--------------------------------------------------------"
cmd="docker run -id $vols opnfv/releng-anteater /bin/bash"
echo "Running docker command $cmd"
container_id=$($cmd)
echo "Container ID is $container_id"
source $WORKSPACE/opnfv-projects.sh
for project in "${PROJECT_LIST[@]}"

do
  cmd="/home/opnfv/venv/bin/anteater --project testproj --path /home/opnfv/anteater/allrepos/$project"
  echo "Executing command inside container"
  echo "$cmd"
  echo "--------------------------------------------------------"
  docker exec $container_id $cmd > $WORKSPACE/"$project".securityaudit.log 2>&1
done

exit_code=$?
echo "--------------------------------------------------------"
echo "Stopping docker container with ID $container_id"
docker stop $container_id


#gsutil cp $WORKSPACE/securityaudit.log \
#    gs://$GS_URL/$PROJECT-securityaudit-weekly.log 2>&1
#
#gsutil -m setmeta \
#    -h "Content-Type:text/html" \
#    -h "Cache-Control:private, max-age=0, no-transform" \
#    gs://$GS_URL/$PROJECT-securityaudit-weekly.log > /dev/null 2>&1