-config.cfg
-*.env
+/config.cfg
+/*.env
*.sqlite
.vscode
custom.css
--- /dev/null
+image: docker/compose
+services:
+ - docker:dind
+cache:
+ key: "$CI_COMMIT_REF_SLUG"
+ paths:
+ - /var/lib/docker
+
+# build:
+# stage: build
+# script:
+# - cp utils/gitlabci/* .
+# - docker-compose build
+
+UI_Test:
+ stage: test
+ script:
+ - cp utils/gitlabci/* .
+ - docker-compose up -d
+ - ./utils/run_migrations.sh
+ - ./utils/tests.sh
+ - docker-compose down
--- /dev/null
+ignored-classes=SQLObject,Registrant,scoped_session
populate(db.session)
db.session.commit()
+
@pytest.fixture
def client():
app.config["TESTING"] = True
psycopg2~=2.7
pytest ~= 5.3
+pytest-cov ~= 2.8
-#!/bin/bash
+#!/bin/sh
# Open SSH to app instance
-#!/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
-#!/bin/bash
+#!/bin/sh
# Open SQL console for the database
--- /dev/null
+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',
+}
--- /dev/null
+POSTGRES_USER=contentdb
+POSTGRES_PASSWORD=password
+POSTGRES_DB=contentdb
+FLASK_DEBUG=1
-#!/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/* ."
-#!/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"
-#!/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"