mirror of
https://github.com/cwinfo/powerdns-admin.git
synced 2024-12-04 19:15:30 +00:00
Adjustment in travis ci configs. Fix importing during first time running db upgrade
This commit is contained in:
parent
0b7580c82f
commit
8af7a6ac9e
14
.travis.yml
14
.travis.yml
@ -2,11 +2,19 @@ language: python
|
||||
python:
|
||||
- "3.5.2"
|
||||
before_install:
|
||||
- 'sudo apt-key adv --fetch-keys http://dl.yarnpkg.com/debian/pubkey.gpg'
|
||||
- 'echo "deb http://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list'
|
||||
- 'travis_retry sudo apt-get update'
|
||||
- 'travis_retry sudo apt-get install python3-dev libxml2-dev libxmlsec1-dev'
|
||||
- 'travis_retry sudo apt-get install python3-dev libxml2-dev libxmlsec1-dev yarn'
|
||||
install:
|
||||
- pip install -r requirements.txt
|
||||
before_script:
|
||||
- mv config_template.py config.py
|
||||
- mv config_template.py config.py
|
||||
- export FLASK_APP=app/__init__.py
|
||||
- flask db upgrade
|
||||
- yarn install --pure-lockfile
|
||||
- flask assets build
|
||||
script:
|
||||
- sh run_travis.sh
|
||||
- sh run_travis.sh
|
||||
cache:
|
||||
yarn: true
|
||||
|
@ -4,6 +4,7 @@ from flask_login import LoginManager
|
||||
from flask_sqlalchemy import SQLAlchemy as SA
|
||||
from flask_migrate import Migrate
|
||||
from flask_oauthlib.client import OAuth
|
||||
from sqlalchemy.exc import OperationalError
|
||||
|
||||
# subclass SQLAlchemy to enable pool_pre_ping
|
||||
class SQLAlchemy(SA):
|
||||
@ -35,4 +36,9 @@ if app.config.get('SAML_ENABLED') and app.config.get('SAML_ENCRYPT'):
|
||||
if not certutil.check_certificate():
|
||||
certutil.create_self_signed_cert()
|
||||
|
||||
from app import models, views
|
||||
from app import models
|
||||
|
||||
try:
|
||||
from app import views
|
||||
except OperationalError:
|
||||
logging.error("You have not initialized the DB yet or DB migration is running...")
|
||||
|
@ -267,7 +267,7 @@
|
||||
applyChanges({'domain': domain}, $SCRIPT_ROOT + '/domain/' + domain + '/update');
|
||||
});
|
||||
|
||||
{% if SETTING.get('record_helper_setting') %}
|
||||
{% if SETTING.get('record_helper') %}
|
||||
//handle wacky record types
|
||||
$(document.body).on("focus", "#current_edit_record_data", function (e) {
|
||||
var record_type = $(this).parents("tr").find('#record_type').val();
|
||||
|
@ -77,6 +77,11 @@ def upgrade():
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
## NOTE:
|
||||
## - Drop action does not work on sqlite3
|
||||
## - This action touchs the `setting` table which loaded in views.py
|
||||
## during app initlization, so the downgrade function won't work
|
||||
## unless we temporary remove importing `views` from `app/__init__.py`
|
||||
op.drop_column('setting', 'view')
|
||||
|
||||
# delete added records in previous version
|
||||
|
Loading…
Reference in New Issue
Block a user