Files
spring-data-demo/jooq/scripts/missing-flyway-module.sh

25 lines
947 B
Bash
Executable File

#!/usr/bin/env bash
# What a Flyway 12 + PostgreSQL project does without the separate flyway-database-postgresql module.
set -uo pipefail
HERE="$(cd "$(dirname "$0")/.." && pwd)"
OUT="$HERE/output/14-missing-flyway-database-module.txt"
WORK="$(mktemp -d)"
mkdir -p "$WORK/m" && cp -r "$HERE/pom.xml" "$HERE/src" "$WORK/m/"
cd "$WORK/m"
python3 - <<'PY'
import re
s=open('pom.xml').read()
s=s.replace(''' <dependency>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-database-postgresql</artifactId>
</dependency>
''','',1)
open('pom.xml','w').write(s)
PY
{
echo "flyway-database-postgresql removed from the application dependencies"
mvn -B -q test -Dtest=JooqSliceTest 2>&1 | grep -E 'Caused by: org.flywaydb.core.api.FlywayException|Tests run:.*Fail' | sed -E 's/^[0-9T:.+-]+ +(WARN|ERROR|INFO) +[0-9]+ --- \[[^]]*\] \[[^]]*\] //' | awk '!s[$0]++' | cut -c1-300 | head -6
} > "$OUT"
cd "$HERE"; rm -rf "$WORK"
cat "$OUT"