Replace shared_lib submodule with shared for decoupling deploy
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 1m24s
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 1m24s
- 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 <noreply@anthropic.com>
This commit is contained in:
@@ -2,7 +2,7 @@ name: Build and Deploy
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [main]
|
branches: [main, decoupling]
|
||||||
|
|
||||||
env:
|
env:
|
||||||
REGISTRY: registry.rose-ash.com:5000
|
REGISTRY: registry.rose-ash.com:5000
|
||||||
@@ -36,8 +36,8 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
ssh "root@$DEPLOY_HOST" "
|
ssh "root@$DEPLOY_HOST" "
|
||||||
cd ${{ env.REPO_DIR }}
|
cd ${{ env.REPO_DIR }}
|
||||||
git fetch origin main
|
git fetch origin ${{ github.ref_name }}
|
||||||
git reset --hard origin/main
|
git reset --hard origin/${{ github.ref_name }}
|
||||||
git submodule update --init --recursive
|
git submodule update --init --recursive
|
||||||
"
|
"
|
||||||
|
|
||||||
|
|||||||
5
.gitmodules
vendored
5
.gitmodules
vendored
@@ -1,3 +1,4 @@
|
|||||||
[submodule "shared_lib"]
|
[submodule "shared"]
|
||||||
path = shared_lib
|
path = shared
|
||||||
url = https://git.rose-ash.com/coop/shared.git
|
url = https://git.rose-ash.com/coop/shared.git
|
||||||
|
branch = decoupling
|
||||||
|
|||||||
11
Dockerfile
11
Dockerfile
@@ -3,9 +3,9 @@
|
|||||||
# ---------- Stage 1: Build editor JS/CSS ----------
|
# ---------- Stage 1: Build editor JS/CSS ----------
|
||||||
FROM node:20-slim AS editor-build
|
FROM node:20-slim AS editor-build
|
||||||
WORKDIR /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
|
RUN npm ci --ignore-scripts 2>/dev/null || npm install
|
||||||
COPY shared_lib/editor/ ./
|
COPY shared/editor/ ./
|
||||||
RUN NODE_ENV=production node build.mjs
|
RUN NODE_ENV=production node build.mjs
|
||||||
|
|
||||||
# ---------- Stage 2: Python runtime ----------
|
# ---------- Stage 2: Python runtime ----------
|
||||||
@@ -25,16 +25,13 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
|||||||
postgresql-client \
|
postgresql-client \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& 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
|
RUN pip install -r requirements.txt
|
||||||
|
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
# Copy built editor assets from stage 1
|
# Copy built editor assets from stage 1
|
||||||
COPY --from=editor-build /static/scripts/editor.js /static/scripts/editor.css shared_lib/static/scripts/
|
COPY --from=editor-build /static/scripts/editor.js /static/scripts/editor.css shared/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
|
|
||||||
|
|
||||||
# ---------- Runtime setup ----------
|
# ---------- Runtime setup ----------
|
||||||
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
|
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ fi
|
|||||||
# Run DB migrations only if RUN_MIGRATIONS=true (blog service only)
|
# Run DB migrations only if RUN_MIGRATIONS=true (blog service only)
|
||||||
if [[ "${RUN_MIGRATIONS:-}" == "true" ]]; then
|
if [[ "${RUN_MIGRATIONS:-}" == "true" ]]; then
|
||||||
echo "Running Alembic migrations..."
|
echo "Running Alembic migrations..."
|
||||||
cd shared_lib && alembic upgrade head && cd /app
|
cd shared && alembic upgrade head && cd /app
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Clear Redis page cache on deploy
|
# Clear Redis page cache on deploy
|
||||||
|
|||||||
1
shared
Submodule
1
shared
Submodule
Submodule shared added at 4dd25526b9
Submodule shared_lib deleted from 0c9b8d6aa2
Reference in New Issue
Block a user