camptocamp / c2cgeoportal

c2cgeoportal application
http://geomapfish.org
Other
64 stars 46 forks source link

[1.6] deploy alembic upgrade bad path #2020

Closed ochriste closed 8 years ago

ochriste commented 8 years ago

dans le fichier pre-restore-database.mako on appel

.build/venv/bin/alembic -c alembic_static.ini upgrade head

mais le path courant n'est pas bon a ce moment la, on est encore dans le dossier deploy, du coup l'ugrade ne se fait pas et la mise a jour de la bd non-plus

/var/cache/deploy/morges_1455190936/morges/hooks/pre-restore-database: 32: /var/cache/deploy/morges_1455190936/morges/hooks/pre-restore-database: .build/venv/bin/alembic: not found
morges-geomapfish.infra.internal deploy.databases: hook failed ('/var/cache/deploy/morges_1455190936/morges/hooks/pre-restore-database')
...
morges-preprod.infra.internal deploy.main: error while deploying to ' morges-geomapfish.infra.internal'.
ochriste commented 8 years ago

the pre-restore-database hook is run from /srv/deploy/<temporary-deploy-folder>/<project-name>/hooks

so to execute correctly the alembic script, we need to do a "cd path/to/project/code/" but we cant do that dynamically at the moment because the pre-restore-database hook does NOT receive the project code path as parameter when it is called.

so either the pre-restore-database hook is called with the [code] section "dest" parameter or we need to add a new parameter in the [databases] section to specify the project path again.

in all case we need to modify the deploy code

ochriste commented 8 years ago

or we can set a copy of the base folder path into a template variable which would be set in pre-restore-database.mako

can we define a path that can be automatically constructed from existing variables ?