Add Gitlab CI support
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/bin/sh
|
||||
|
||||
# Open SSH to app instance
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
#!/bin/bash
|
||||
#!/bin/sh
|
||||
|
||||
# Create a database migration, and copy it back to the host.
|
||||
|
||||
docker exec -it contentdb_app_1 sh -c "FLASK_CONFIG=../config.cfg FLASK_APP=app/__init__.py flask db migrate"
|
||||
docker exec -u root -it contentdb_app_1 sh -c "cp /home/cdb/migrations/versions/* /source/migrations/versions/"
|
||||
docker exec contentdb_app_1 sh -c "FLASK_CONFIG=../config.cfg FLASK_APP=app/__init__.py flask db migrate"
|
||||
docker exec -u root contentdb_app_1 sh -c "cp /home/cdb/migrations/versions/* /source/migrations/versions/"
|
||||
|
||||
USER=$(whoami)
|
||||
sudo chown -R $USER:$USER migrations/versions
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/bin/sh
|
||||
|
||||
# Open SQL console for the database
|
||||
|
||||
|
||||
31
utils/gitlabci/config.cfg
Normal file
31
utils/gitlabci/config.cfg
Normal file
@@ -0,0 +1,31 @@
|
||||
USER_APP_NAME="Content DB"
|
||||
SERVER_NAME="localhost:5123"
|
||||
BASE_URL="http://" + SERVER_NAME
|
||||
|
||||
SECRET_KEY="changeme"
|
||||
WTF_CSRF_SECRET_KEY="changeme"
|
||||
|
||||
SQLALCHEMY_DATABASE_URI = "postgres://contentdb:password@db:5432/contentdb"
|
||||
|
||||
GITHUB_CLIENT_ID = ""
|
||||
GITHUB_CLIENT_SECRET = ""
|
||||
|
||||
REDIS_URL='redis://redis:6379'
|
||||
CELERY_BROKER_URL='redis://redis:6379'
|
||||
CELERY_RESULT_BACKEND='redis://redis:6379'
|
||||
|
||||
USER_ENABLE_USERNAME = True
|
||||
USER_ENABLE_REGISTER = False
|
||||
USER_ENABLE_CHANGE_USERNAME = False
|
||||
USER_ENABLE_EMAIL = False
|
||||
|
||||
MAIL_UTILS_ERROR_SEND_TO = [""]
|
||||
|
||||
UPLOAD_DIR="/var/cdb/uploads/"
|
||||
THUMBNAIL_DIR="/var/cdb/thumbnails/"
|
||||
|
||||
TEMPLATES_AUTO_RELOAD = True
|
||||
|
||||
LANGUAGES = {
|
||||
'en': 'English',
|
||||
}
|
||||
4
utils/gitlabci/config.env
Normal file
4
utils/gitlabci/config.env
Normal file
@@ -0,0 +1,4 @@
|
||||
POSTGRES_USER=contentdb
|
||||
POSTGRES_PASSWORD=password
|
||||
POSTGRES_DB=contentdb
|
||||
FLASK_DEBUG=1
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/bin/bash
|
||||
#!/bin/sh
|
||||
|
||||
# Hot/live reload - only works in debug mode
|
||||
|
||||
docker exec -it contentdb_app_1 sh -c "cp -r /source/* ."
|
||||
docker exec contentdb_app_1 sh -c "cp -r /source/* ."
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/bin/bash
|
||||
#!/bin/sh
|
||||
|
||||
# Run all pending migrations
|
||||
|
||||
docker exec -it contentdb_app_1 sh -c "FLASK_CONFIG=../config.cfg FLASK_APP=app/__init__.py flask db upgrade"
|
||||
docker exec contentdb_app_1 sh -c "FLASK_CONFIG=../config.cfg FLASK_APP=app/__init__.py flask db upgrade"
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
#!/bin/bash
|
||||
#!/bin/sh
|
||||
|
||||
docker exec -it contentdb_app_1 sh -c "FLASK_CONFIG=../config.cfg FLASK_APP=app/__init__.py python -m pytest app/tests/ --disable-warnings"
|
||||
docker exec contentdb_app_1 sh -c "FLASK_CONFIG=../config.cfg FLASK_APP=app/__init__.py python -m pytest app/tests/ --cov=app --disable-warnings"
|
||||
|
||||
Reference in New Issue
Block a user