2 # SPDX-license-identifier: Apache-2.0
3 ##############################################################################
4 # Copyright (c) 2017 The Linux Foundation and others.
5 # All rights reserved. This program and the accompanying materials
6 # are made available under the terms of the Apache License, Version 2.0
7 # which accompanies this distribution, and is available at
8 # http://www.apache.org/licenses/LICENSE-2.0
9 ##############################################################################
11 ANTEATER_SCAN_PATCHSET="${ANTEATER_SCAN_PATCHSET:-true}"
16 # Ensure any user can read the reports directory
19 ANTEATER_FILES="--patchset /home/opnfv/anteater/$PROJECT/patchset"
21 if [[ "$ANTEATER_SCAN_PATCHSET" == "true" ]]; then
22 echo "Generating patchset file to list changed files"
23 git diff HEAD^1 --name-only | sed "s#^#/home/opnfv/anteater/$PROJECT/#" > $WORKSPACE/patchset
24 echo "Changed files are"
25 echo "--------------------------------------------------------"
26 cat $WORKSPACE/patchset
27 echo "--------------------------------------------------------"
29 echo "Checking full project $PROJECT"
30 ANTEATER_FILES="--path /home/opnfv/anteater/$PROJECT"
33 vols="-v $WORKSPACE:/home/opnfv/anteater/$PROJECT -v $WORKSPACE/$REPORTDIR:/home/opnfv/anteater/$REPORTDIR"
34 envs="-e PROJECT=$PROJECT"
36 echo "Pulling releng-anteater docker image"
37 echo "--------------------------------------------------------"
38 docker pull opnfv/releng-anteater
39 echo "--------------------------------------------------------"
41 cmd="docker run -i $envs $vols --rm opnfv/releng-anteater \
42 /home/opnfv/venv/bin/anteater --project $PROJECT $ANTEATER_FILES"
43 echo "Running docker container"
45 $cmd > $WORKSPACE/securityaudit.log 2>&1
47 echo "--------------------------------------------------------"
48 echo "Docker container exited with code: $exit_code"
49 echo "--------------------------------------------------------"