From a1eaba5119c9e15176e988f277311f1721a4b013 Mon Sep 17 00:00:00 2001 From: giles Date: Wed, 11 Feb 2026 13:29:21 +0000 Subject: [PATCH] Replace shared_lib submodule with shared for decoupling deploy MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Swap shared_lib submodule → shared (tracking decoupling branch) - Dockerfile: shared_lib/ → shared/, remove bp symlink hack - entrypoint.sh: cd shared for alembic upgrade head - CI: trigger on decoupling branch, use dynamic ref_name Co-Authored-By: Claude Opus 4.6 --- .gitea/workflows/ci.yml | 6 +++--- .gitmodules | 5 +++-- Dockerfile | 11 ++++------- entrypoint.sh | 2 +- shared | 1 + shared_lib | 1 - 6 files changed, 12 insertions(+), 14 deletions(-) create mode 160000 shared delete mode 160000 shared_lib diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 6a4dec1..6283f0b 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -2,7 +2,7 @@ name: Build and Deploy on: push: - branches: [main] + branches: [main, decoupling] env: REGISTRY: registry.rose-ash.com:5000 @@ -36,8 +36,8 @@ jobs: run: | ssh "root@$DEPLOY_HOST" " cd ${{ env.REPO_DIR }} - git fetch origin main - git reset --hard origin/main + git fetch origin ${{ github.ref_name }} + git reset --hard origin/${{ github.ref_name }} git submodule update --init --recursive " diff --git a/.gitmodules b/.gitmodules index db171b9..b509b5a 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,4 @@ -[submodule "shared_lib"] - path = shared_lib +[submodule "shared"] + path = shared url = https://git.rose-ash.com/coop/shared.git + branch = decoupling diff --git a/Dockerfile b/Dockerfile index 21e4802..321a9f5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,9 +3,9 @@ # ---------- Stage 1: Build editor JS/CSS ---------- FROM node:20-slim AS editor-build WORKDIR /build -COPY shared_lib/editor/package.json shared_lib/editor/package-lock.json* ./ +COPY shared/editor/package.json shared/editor/package-lock.json* ./ RUN npm ci --ignore-scripts 2>/dev/null || npm install -COPY shared_lib/editor/ ./ +COPY shared/editor/ ./ RUN NODE_ENV=production node build.mjs # ---------- Stage 2: Python runtime ---------- @@ -25,16 +25,13 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ postgresql-client \ && rm -rf /var/lib/apt/lists/* -COPY shared_lib/requirements.txt ./requirements.txt +COPY shared/requirements.txt ./requirements.txt RUN pip install -r requirements.txt COPY . . # Copy built editor assets from stage 1 -COPY --from=editor-build /static/scripts/editor.js /static/scripts/editor.css shared_lib/static/scripts/ - -# Link app blueprints into the shared library's namespace -RUN rm -rf /app/shared_lib/suma_browser/app/bp && ln -s /app/bp /app/shared_lib/suma_browser/app/bp +COPY --from=editor-build /static/scripts/editor.js /static/scripts/editor.css shared/static/scripts/ # ---------- Runtime setup ---------- COPY entrypoint.sh /usr/local/bin/entrypoint.sh diff --git a/entrypoint.sh b/entrypoint.sh index 607fe25..208de79 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -13,7 +13,7 @@ fi # Run DB migrations only if RUN_MIGRATIONS=true (blog service only) if [[ "${RUN_MIGRATIONS:-}" == "true" ]]; then echo "Running Alembic migrations..." - cd shared_lib && alembic upgrade head && cd /app + cd shared && alembic upgrade head && cd /app fi # Clear Redis page cache on deploy diff --git a/shared b/shared new file mode 160000 index 0000000..4dd2552 --- /dev/null +++ b/shared @@ -0,0 +1 @@ +Subproject commit 4dd25526b9ddd2da7ab1dc125ed9d15e78cd74ac diff --git a/shared_lib b/shared_lib deleted file mode 160000 index 0c9b8d6..0000000 --- a/shared_lib +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 0c9b8d6aa2b8f48c30091e0ab57170eb52040cc9