ci: full deploy pipeline — build image, run DB migrations, restart odoo
Some checks failed
Deploy Backend to Staging / Deploy backend to staging (push) Failing after 17m35s

This commit is contained in:
root
2026-04-27 21:51:40 +02:00
parent a6fa9d78d8
commit fc384efe85
3 changed files with 31 additions and 3 deletions

View File

@@ -16,13 +16,40 @@ jobs:
git reset --hard origin/main
echo "Deployed: $(git log -1 --oneline)"
- name: Restart Odoo with updated config
- name: Build Odoo image
run: |
cd /opt/encoach/encoach_backend_new_v2
# odoo.conf is not in the repo; copy from the persistent override for the build context
cp /opt/encoach/overrides/odoo.conf ./odoo.conf
docker compose \
-f docker-compose.yml \
-f /opt/encoach/overrides/encoach.override.yml \
build odoo
rm -f ./odoo.conf
- name: Run DB migrations
run: |
# Dynamically fetch the list of installed encoach_* modules from the DB
MODULES=$(docker exec encoach-v4-db psql -U odoo -d encoach_v2 -tAc \
"SELECT string_agg(name, ,) FROM ir_module_module WHERE state=installed AND name LIKE encoach%;")
echo "Upgrading modules: $MODULES"
docker run --rm \
--network encoach_backend_new_v2_default \
-v /opt/encoach/overrides/odoo.conf:/etc/odoo/odoo.conf:ro \
-v /opt/encoach/encoach_backend_new_v2:/mnt/extra-addons:ro \
-v /opt/encoach/encoach_backend_new_v2/openeducat_erp-19.0/openeducat_erp-19.0:/mnt/extra-addons/openeducat_erp-19.0:ro \
-v encoach_backend_new_v2_odoo-web-data:/var/lib/odoo \
encoach-backend:latest \
odoo -u "$MODULES" --stop-after-init 2>&1 | tail -20
- name: Restart Odoo
run: |
cd /opt/encoach/encoach_backend_new_v2
docker compose \
-f docker-compose.yml \
-f /opt/encoach/overrides/encoach.override.yml \
up -d odoo
up -d --no-deps odoo
- name: Smoke test
run: |

View File

@@ -3,7 +3,7 @@ FROM odoo:19.0
USER root
COPY requirements.txt /tmp/requirements.txt
RUN pip3 install --no-cache-dir -r /tmp/requirements.txt
RUN pip3 install --break-system-packages --no-cache-dir --ignore-installed typing_extensions -r /tmp/requirements.txt
COPY custom_addons /opt/odoo/custom_addons
COPY odoo.conf /etc/odoo/odoo.conf

View File

@@ -12,3 +12,4 @@ psycopg2-binary>=2.9.0
# `OpenAIService` wrapper; LangGraph only adds the state machine + tool routing on top.
langgraph>=0.2.0
langchain-core>=0.3.0
sentence_transformers>=2.7.0