Skip to content
Snippets Groups Projects
Verified Commit 959f5823 authored by sistason's avatar sistason
Browse files

setup CI test for instance_path

parent 0ca77edc
Branches
No related tags found
No related merge requests found
......@@ -16,6 +16,24 @@ before_script:
- python3 -m coverage --version
- echo "${CI_COMMIT_TAG}" | grep -qE "v[0-9]+[.][0-9]+[.][0-9]+.*" && export UFFD_PACKAGE_VERSION="${CI_COMMIT_TAG#v}" || export UFFD_PACKAGE_VERSION="${CI_COMMIT_SHA}"
build_test_instance_path:
image:
name: gcr.io/kaniko-project/executor:debug-v0.24.0
entrypoint: [""]
stage: build
before_script:
- echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
script:
- /kaniko/executor --context "$CI_PROJECT_DIR" --dockerfile Dockerfile --destination "${CI_REGISTRY_IMAGE}:test-instance-path"
test_instance_path:
stage: test
image: registry.git.cccv.de/uffd/uffd:test-instance-path
before_script:
- python --version
script:
- FLASK_APP=uffd CONFIG_PATH=/etc/uffd/uffd.cfg flask db upgrade
.build:
stage: build
......
FROM python:3.10
RUN pip3 install flask==1.1.2 Flask-SQLAlchemy==2.1 qrcode==6.1 fido2==0.5.0 oauthlib==2.1.0 Flask-OAuthlib==0.9.5 \
Flask-Migrate==2.1.1 Flask-Babel==2.0.0 alembic==1.0.0 argon2-cffi==18.3.0 certifi==2018.8.24 cffi==1.15.0 \
chardet==3.0.4 click==7.0 cryptography==2.6.1 idna==2.6 itsdangerous==0.24 Jinja2==2.11 MarkupSafe==1.1.0 \
pyasn1==0.4.2 pycparser==2.19 requests==2.21.0 requests-oauthlib==1.0.0 six==1.12.0 SQLAlchemy==1.2.18 \
urllib3==1.24.1 Werkzeug==1 python-dateutil==2.7.3 Mako==1.0.7 \
pyyaml==6.0 uwsgi==2.0.20
RUN useradd uffd && mkdir /etc/uffd && echo "SECRET_KEY='foo'" > /etc/uffd/uffd.cfg
COPY uwsgi.ini /etc/uffd/
COPY uffd /usr/share/uffd/uffd
RUN pybabel compile -d /usr/share/uffd/uffd/translations
#ENTRYPOINT ["uwsgi", "/etc/uffd/uwsgi.ini","--http", "0.0.0.0:8080"]
\ No newline at end of file
......@@ -42,6 +42,7 @@ def load_config_file(app, path, silent=False):
def init_config(app: Flask, test_config):
# set development default config values
print(app.instance_path)
app.config["SQLALCHEMY_DATABASE_URI"] = f"sqlite:///{os.path.join(app.instance_path, 'uffd.sqlit3')}"
app.config.from_pyfile('default_config.cfg')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment