mirror of
https://github.com/Cian-H/am-d-model.eu.git
synced 2025-12-22 21:41:57 +00:00
Added customisation plugin to invenio instance
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
# yaml-language-server: $schema=https://raw.githubusercontent.com/compose-spec/compose-spec/master/schema/compose-spec.json
|
# yaml-language-server: $schema=https://raw.githubusercontent.com/compose-spec/compose-spec/master/schema/compose-spec.json
|
||||||
services:
|
services:
|
||||||
site:
|
site:
|
||||||
build: .
|
build: src
|
||||||
networks:
|
networks:
|
||||||
- am-d-model-network
|
- am-d-model-network
|
||||||
expose:
|
expose:
|
||||||
@@ -41,14 +41,15 @@ services:
|
|||||||
awslogs-stream: caddy
|
awslogs-stream: caddy
|
||||||
awslogs-create-group: "true"
|
awslogs-create-group: "true"
|
||||||
invenio-rdm:
|
invenio-rdm:
|
||||||
image: ghcr.io/front-matter/invenio-rdm-starter:v12.0.13.4
|
image: invenio
|
||||||
networks:
|
networks:
|
||||||
- am-d-model-network
|
- am-d-model-network
|
||||||
pull_policy: if_not_present
|
pull_policy: if_not_present
|
||||||
volumes:
|
volumes:
|
||||||
- uploaded_data:/opt/invenio/var/instance/data
|
- uploaded_data:/opt/invenio/var/instance/data
|
||||||
- archived_data:/opt/invenio/var/instance/archive
|
- archived_data:/opt/invenio/var/instance/archive
|
||||||
- ./invenio_assets:/opt/invenio/var/instance/static/custom_assets # Add static assets for theming
|
- ./invenio/assets:/opt/invenio/var/instance/static/custom_assets # Add static assets for theming
|
||||||
|
- ./invenio/plugin:/opt/invenio/var/instance/static/plugin # Add plugin for customisations
|
||||||
- ./invenio.cfg:/opt/invenio/var/instance/invenio.cfg # Override the config with our custom one
|
- ./invenio.cfg:/opt/invenio/var/instance/invenio.cfg # Override the config with our custom one
|
||||||
environment:
|
environment:
|
||||||
# Production mode
|
# Production mode
|
||||||
@@ -154,10 +155,10 @@ services:
|
|||||||
awslogs-stream: invenio-rdm
|
awslogs-stream: invenio-rdm
|
||||||
awslogs-create-group: "true"
|
awslogs-create-group: "true"
|
||||||
worker:
|
worker:
|
||||||
|
image: invenio
|
||||||
command: "celery -A invenio_app.celery worker --beat --events --loglevel=WARNING"
|
command: "celery -A invenio_app.celery worker --beat --events --loglevel=WARNING"
|
||||||
networks:
|
networks:
|
||||||
- am-d-model-network
|
- am-d-model-network
|
||||||
image: ghcr.io/front-matter/invenio-rdm-starter:v12.0.13.4
|
|
||||||
pull_policy: if_not_present
|
pull_policy: if_not_present
|
||||||
volumes:
|
volumes:
|
||||||
- uploaded_data:/opt/invenio/var/instance/data
|
- uploaded_data:/opt/invenio/var/instance/data
|
||||||
|
|||||||
5
invenio/Dockerfile
Normal file
5
invenio/Dockerfile
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
FROM ghcr.io/front-matter/invenio-rdm-starter:v12.0.13.4
|
||||||
|
|
||||||
|
RUN /opt/invenio/.venv/bin/python -m ensurepip
|
||||||
|
RUN /opt/invenio/.venv/bin/python -m pip install -e /opt/invenio/var/instance/static/plugin
|
||||||
|
RUN /opt/invenio/.venv/bin/python -m pip uninstall -e pip
|
||||||
|
Before Width: | Height: | Size: 65 KiB After Width: | Height: | Size: 65 KiB |
10
invenio/plugin/__init__.py
Normal file
10
invenio/plugin/__init__.py
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
from flask import Blueprint
|
||||||
|
|
||||||
|
|
||||||
|
def init_app(app):
|
||||||
|
"""Initialize application."""
|
||||||
|
app.register_blueprint(views.blueprint)
|
||||||
|
return app
|
||||||
|
|
||||||
|
|
||||||
|
from . import views
|
||||||
12
invenio/plugin/setup.py
Normal file
12
invenio/plugin/setup.py
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
from setuptools import setup
|
||||||
|
|
||||||
|
setup(
|
||||||
|
name="custom_invenio_plugin",
|
||||||
|
version="0.1.0",
|
||||||
|
packages=["custom_invenio_plugin"],
|
||||||
|
entry_points={
|
||||||
|
"invenio_base.apps": [
|
||||||
|
"custom_menu = custom_invenio_plugin:init_app",
|
||||||
|
],
|
||||||
|
},
|
||||||
|
)
|
||||||
17
invenio/plugin/views.py
Normal file
17
invenio/plugin/views.py
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
from flask import Blueprint
|
||||||
|
from flask_menu import current_menu
|
||||||
|
|
||||||
|
blueprint = Blueprint(
|
||||||
|
"custom_menu",
|
||||||
|
__name__,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@blueprint.before_app_first_request
|
||||||
|
def init_menu():
|
||||||
|
"""Add custom items to main menu."""
|
||||||
|
current_menu.submenu("main").register(
|
||||||
|
"About AM-D-Model",
|
||||||
|
"https://am-d-model.eu",
|
||||||
|
order=0,
|
||||||
|
)
|
||||||
Reference in New Issue
Block a user