Skip to content

Commit

Permalink
ENG-1174 percona-docker repo issues with repositories
Browse files Browse the repository at this point in the history
  • Loading branch information
adivinho committed Mar 21, 2023
1 parent 2c4ec90 commit 7ad57da
Showing 1 changed file with 21 additions and 6 deletions.
27 changes: 21 additions & 6 deletions test/detect-images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ set -o errexit

declare -A dockerfilePaths
pathToTests=$(dirname $0)
old_os_versions=("jessie" "wheezy" "trusty")

echo "Changed files between $@:"
for file in $(git --no-pager diff --name-only "$@"); do
Expand All @@ -26,12 +27,26 @@ for dockerfilePath in "${!dockerfilePaths[@]}"; do
docker build --no-cache -t $tag $dockerfilePath
echo

echo ======================================================
echo = Testing $tag
echo ======================================================
echo + $pathToTests/run.sh $tag
$pathToTests/run.sh $tag
echo
os_used="$(grep FROM $dockerfilePath/Dockerfile | cut -d':' -f 2)"
echo $os_version
for old_os in ${old_os_versions[@]}
do
if [[ $os_used == $old_os ]]; then
echo ======================================================
echo = Tests are skipped due to an old os version
echo ======================================================
skip_tests=1
break
fi
done
if [[ $skip_tests != 1 ]]; then
echo ======================================================
echo = Testing $tag
echo ======================================================
echo + $pathToTests/run.sh $tag
$pathToTests/run.sh $tag
echo
fi
done

echo "Everything OK"

0 comments on commit 7ad57da

Please sign in to comment.