pull/2/head
Hari Sekhon 7 years ago
commit c8b44efe88

@ -19,27 +19,53 @@ srcdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
. "$srcdir/docker.sh"
# Caches we want to check have been removed:
#
# .cache => Python pip
#
# .cpan => Perl
# .cpanm
#
# .gem => Ruby
#
# Java / Scala / Groovy:
#
# .gradle => Gradle
# .groovy => Groovy
# .ivy => Ivy (Sbt / Gradle)
# .ivy2
# .m2 => Maven
# .sbt => SBT
cache_list="
.cache
.cpan
.cpanm
.gem
.gradle
.groovy
.ivy
.ivy2
.m2
.sbt
"
if is_inside_docker; then
# Python pip => .cache
# Perl => .cpan / .cpanm
# Ruby => .gem
# Java / Scala / Groovy:
# Maven => .m2
# Ivy => .ivy .ivy2
# (Sbt / Gradle)
for x in \
.cache \
.cpan \
.cpanm \
.m2 \
.ivy \
.ivy2 \
; do
for y in /root ~; do
# This might fail if we're not running as root :-/
# consider sudo'ing and find / -type d -name $x but that might find .cache under some app or something, although we should probably remove that too
# for now this is good enough as most dockers are built as root
# should test for sudo availability as well
if [ -e "$y/$x" ]; then
echo "$y/$x detected, should have been removed from docker build"
exit 1
fi
done
done
if [ -n "$(find / -type f -name pytools_checks)" ]; then
echo "pytools_checks detected, should have been removed from docker build"
exit 1
fi
fi

@ -18,6 +18,7 @@ set -euo pipefail
srcdir2="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
. "$srcdir2/utils.sh"
. "$srcdir2/docker.sh"
srcdir="$srcdir2"
@ -34,6 +35,9 @@ if [ "$PROJECT" = "pytools" ]; then
elif [ "$PROJECT" = "Dockerfiles" ]; then
echo "detected running in Dockerfiles repo, skipping checks here as will be called in bash-tools/all.sh..."
skip_checks=1
elif is_inside_docker; then
echo "detected running inside Docker, skipping pytools checks"
skip_checks=1
fi
if [ $skip_checks = 1 ]; then

Loading…
Cancel
Save