mirror of https://gitee.com/openkylin/qemu.git
run-coverity-scan: download tools outside the container
This lets us look at coverity_tool.md5 across executions of run-coverity-scan and skip the download. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
3077453cf9
commit
2e90470e90
|
@ -127,5 +127,6 @@ RUN dnf install -y $PACKAGES
|
||||||
RUN rpm -q $PACKAGES | sort > /packages.txt
|
RUN rpm -q $PACKAGES | sort > /packages.txt
|
||||||
ENV PATH $PATH:/usr/libexec/python3-sphinx/
|
ENV PATH $PATH:/usr/libexec/python3-sphinx/
|
||||||
ENV COVERITY_TOOL_BASE=/coverity-tools
|
ENV COVERITY_TOOL_BASE=/coverity-tools
|
||||||
|
COPY coverity_tool.tgz coverity_tool.tgz
|
||||||
|
RUN mkdir -p /coverity-tools/coverity_tool && cd /coverity-tools/coverity_tool && tar xf /coverity_tool.tgz
|
||||||
COPY run-coverity-scan run-coverity-scan
|
COPY run-coverity-scan run-coverity-scan
|
||||||
RUN ./run-coverity-scan --update-tools-only --tokenfile /work/token
|
|
||||||
|
|
|
@ -116,15 +116,17 @@ update_coverity_tools () {
|
||||||
echo "Downloaded tarball didn't match md5sum!"
|
echo "Downloaded tarball didn't match md5sum!"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
# extract the new one, keeping it corralled in a 'coverity_tool' directory
|
|
||||||
echo "Unpacking coverity build tools..."
|
|
||||||
mkdir -p coverity_tool
|
|
||||||
cd coverity_tool
|
|
||||||
tar xf ../coverity_tool.tgz
|
|
||||||
cd ..
|
|
||||||
mv coverity_tool.md5.new coverity_tool.md5
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
if [ "$DOCKER" != yes ]; then
|
||||||
|
# extract the new one, keeping it corralled in a 'coverity_tool' directory
|
||||||
|
echo "Unpacking coverity build tools..."
|
||||||
|
mkdir -p coverity_tool
|
||||||
|
cd coverity_tool
|
||||||
|
tar xf ../coverity_tool.tgz
|
||||||
|
cd ..
|
||||||
|
mv coverity_tool.md5.new coverity_tool.md5
|
||||||
|
fi
|
||||||
|
fi
|
||||||
rm -f coverity_tool.md5.new
|
rm -f coverity_tool.md5.new
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -296,6 +298,14 @@ if [ -z "$COVERITY_EMAIL" ]; then
|
||||||
COVERITY_EMAIL="$(git config user.email)"
|
COVERITY_EMAIL="$(git config user.email)"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Otherwise, continue with the full build and upload process.
|
||||||
|
|
||||||
|
check_upload_permissions
|
||||||
|
|
||||||
|
if [ "$UPDATE" != no ]; then
|
||||||
|
update_coverity_tools
|
||||||
|
fi
|
||||||
|
|
||||||
# Run ourselves inside docker if that's what the user wants
|
# Run ourselves inside docker if that's what the user wants
|
||||||
if [ "$DOCKER" = yes ]; then
|
if [ "$DOCKER" = yes ]; then
|
||||||
# Put the Coverity token into a temporary file that only
|
# Put the Coverity token into a temporary file that only
|
||||||
|
@ -315,13 +325,13 @@ if [ "$DOCKER" = yes ]; then
|
||||||
if [ "$UPDATE" != no ]; then
|
if [ "$UPDATE" != no ]; then
|
||||||
# build docker container including the coverity-scan tools
|
# build docker container including the coverity-scan tools
|
||||||
echo "Building docker container..."
|
echo "Building docker container..."
|
||||||
# TODO: This re-downloads the tools every time, rather than
|
# TODO: This re-unpacks the tools every time, rather than caching
|
||||||
# caching and reusing the image produced with the downloaded tools.
|
# and reusing the image produced by the COPY of the .tgz file.
|
||||||
# Not sure why.
|
# Not sure why.
|
||||||
tests/docker/docker.py --engine ${DOCKER_ENGINE} build \
|
tests/docker/docker.py --engine ${DOCKER_ENGINE} build \
|
||||||
-t coverity-scanner -f scripts/coverity-scan/coverity-scan.docker \
|
-t coverity-scanner -f scripts/coverity-scan/coverity-scan.docker \
|
||||||
-v "$SECRETDIR:/work" \
|
--extra-files scripts/coverity-scan/run-coverity-scan \
|
||||||
--extra-files scripts/coverity-scan/run-coverity-scan
|
"$COVERITY_TOOL_BASE"/coverity_tool.tgz
|
||||||
fi
|
fi
|
||||||
echo "Archiving sources to be analyzed..."
|
echo "Archiving sources to be analyzed..."
|
||||||
./scripts/archive-source.sh "$SECRETDIR/qemu-sources.tgz"
|
./scripts/archive-source.sh "$SECRETDIR/qemu-sources.tgz"
|
||||||
|
@ -352,14 +362,6 @@ if [ "$DOCKER" = yes ]; then
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Otherwise, continue with the full build and upload process.
|
|
||||||
|
|
||||||
check_upload_permissions
|
|
||||||
|
|
||||||
if [ "$UPDATE" != no ]; then
|
|
||||||
update_coverity_tools
|
|
||||||
fi
|
|
||||||
|
|
||||||
TOOLBIN="$(cd "$COVERITY_TOOL_BASE" && echo $PWD/coverity_tool/cov-analysis-*/bin)"
|
TOOLBIN="$(cd "$COVERITY_TOOL_BASE" && echo $PWD/coverity_tool/cov-analysis-*/bin)"
|
||||||
|
|
||||||
if ! test -x "$TOOLBIN/cov-build"; then
|
if ! test -x "$TOOLBIN/cov-build"; then
|
||||||
|
|
Loading…
Reference in New Issue