flake: patch migrate.py to discover system_migrations

Previously "system_migrations" were silently not applied, because the
migration script tries to find them relatively to its own location, but
here they are not in the same /bin folder that migrate.py is placed in.
This commit is contained in:
WilliButz 2023-07-13 11:58:28 +02:00
parent 71f8f2a652
commit 8d4ad4d50c
No known key found for this signature in database
GPG key ID: FB0513677AB15BEA

View file

@ -164,6 +164,10 @@
cp ${authentik-src}/lifecycle/migrate.py $out/bin/migrate.py cp ${authentik-src}/lifecycle/migrate.py $out/bin/migrate.py
chmod +w $out/bin/migrate.py chmod +w $out/bin/migrate.py
patchShebangs $out/bin/migrate.py patchShebangs $out/bin/migrate.py
substituteInPlace $out/bin/migrate.py \
--replace \
'migration in Path(__file__).parent.absolute().glob("system_migrations/*.py")' \
'migration in Path("${staticWorkdirDeps}/lifecycle").glob("system_migrations/*.py")'
wrapProgram $out/bin/migrate.py \ wrapProgram $out/bin/migrate.py \
--prefix PATH : ${pythonEnv}/bin \ --prefix PATH : ${pythonEnv}/bin \
--prefix PYTHONPATH : ${staticWorkdirDeps} --prefix PYTHONPATH : ${staticWorkdirDeps}