Skip to content

Commit

Permalink
Alembic will use the same config file
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrunner committed Jul 2, 2018
1 parent 3e14472 commit 5051bb1
Show file tree
Hide file tree
Showing 10 changed files with 24 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,5 @@ __pycache__/
/geoportal/{{package}}_geoportal/static/build/
/geoportal/node_modules
/geoportal/webpack.apps.js
/vars_alembic.yaml
/.upgrade.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---

extends: ${alembic_yaml_file}

environment:
- name: PGSCHEMA
- name: PGSCHEMA_STATIC

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ __pycache__/
/c2cgeoportal_commons/
/c2cgeoportal_geoportal/
/c2cgeoportal_admin/
/vars_alembic.yaml
/npm-packages
/package-lock.json
/.upgrade.yaml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,9 @@ files_to_remove:
- file: alembic.yaml
version: 2.3.2
from: 2.3.0
- file: vars_testdb.yaml
version: 2.3.2
from: 2.3.0

files_to_move:
- from: vars_{{package}}.yaml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,9 @@ files_to_remove:
- file: alembic.yaml
version: 2.3.2
from: 2.3.0
- file: vars_testdb.yaml
version: 2.3.2
from: 2.3.0

files_to_move:
- from: vars_{{package}}.yaml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,8 @@ I18N_DEPENDENCIES += project.yaml /build/requirements.timestamp


# Alembic

ALEMBIC_YAML_FILE ?= vars_testdb.yaml
ALEMBIC_YAML_FILE ?= $(VARS_FILE)
export ALEMBIC_YAML_FILE

# CGXP
JSBUILD_MAIN_FILES = $(shell find geoportal/$(PACKAGE)_geoportal/static/lib/cgxp geoportal/$(PACKAGE)_geoportal/static/js -name "*.js" -print 2> /dev/null)
Expand Down Expand Up @@ -724,7 +724,7 @@ geoportal/alembic.yaml: $(ALEMBIC_YAML_FILE) vars.yaml CONST_vars.yaml
c2c-template --vars $< --get-config /build/_alembic.yaml srid schema schema_static sqlalchemy.url cache
mv /build/_alembic.yaml $@

testdb/11-schemas.sql: $(ALEMBIC_YAML_FILE) testdb/11-schemas.sql_mako vars.yaml CONST_vars.yaml
testdb/11-schemas.sql: vars_alembic.yaml $(ALEMBIC_YAML_FILE) testdb/11-schemas.sql_mako vars.yaml CONST_vars.yaml
$(PRERULE_CMD)
rm --force testdb/11-schemas.sql.mako
ln -s 11-schemas.sql_mako testdb/11-schemas.sql.mako
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ vars:
# sqlalchemy static schema
schema_static: '{PGSCHEMA_STATIC}'

alembic_yaml_file: '{ALEMBIC_YAML_FILE}'

dbsessions: {}

# mapserver connexion string
Expand Down Expand Up @@ -555,6 +557,7 @@ environment:
- BUILD_VOLUME_NAME
- PROJECT_DIRECTORY
- INSTANCE
- ALEMBIC_YAML_FILE

runtime_environment:
- name: VISIBLE_WEB_HOST
Expand Down
5 changes: 3 additions & 2 deletions travis/create-new-nondocker-project.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,9 @@ sudo a2enmod fcgid
geoportal/config.yaml \
docker-compose-build.yaml docker-build-testdb
FINALISE=TRUE make --makefile=travis.mk build
./docker-run alembic --config=geoportal/alembic.ini --name=main upgrade head
./docker-run alembic --config=geoportal/alembic.ini --name=static upgrade head
DOCKER_RUN_ALEMBIC="./docker-run --env=PGSCHEMA=main --env=PGSCHEMA_STATIC=main_static alembic"
${DOCKER_RUN_ALEMBIC} --config=geoportal/alembic.ini --name=main upgrade head
${DOCKER_RUN_ALEMBIC} --config=geoportal/alembic.ini --name=static upgrade head
# Create default theme
./docker-run /build/venv/bin/python /usr/local/bin/create-demo-theme --iniconfig geoportal/production.ini
./docker-run make --makefile=travis.mk update-po
Expand Down

0 comments on commit 5051bb1

Please sign in to comment.