CI: use git archive for sibling models (atomic, race-safe)
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 49s
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 49s
The cp approach failed when sibling repos were mid-update from their own CI runs. git archive reads directly from git objects, and git fetch ensures origin/decoupling is available even if the sibling working tree is on a different branch. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -39,13 +39,14 @@ jobs:
|
|||||||
git fetch origin ${{ github.ref_name }}
|
git fetch origin ${{ github.ref_name }}
|
||||||
git reset --hard origin/${{ github.ref_name }}
|
git reset --hard origin/${{ github.ref_name }}
|
||||||
git submodule update --init --recursive
|
git submodule update --init --recursive
|
||||||
# Copy sibling app models for cross-domain imports
|
# Copy sibling app models for cross-domain imports (read from git objects to avoid race conditions)
|
||||||
for sibling in blog market cart events; do
|
for sibling in blog market cart events; do
|
||||||
rm -rf \$sibling/__init__.py \$sibling/models
|
rm -rf \$sibling/__init__.py \$sibling/models
|
||||||
if [ -d /root/rose-ash/\$sibling/models ]; then
|
repo=/root/rose-ash/\$sibling
|
||||||
|
if [ -d \$repo/.git ]; then
|
||||||
|
git -C \$repo fetch origin ${{ github.ref_name }} 2>/dev/null || true
|
||||||
mkdir -p \$sibling
|
mkdir -p \$sibling
|
||||||
cp /root/rose-ash/\$sibling/__init__.py \$sibling/ 2>/dev/null || touch \$sibling/__init__.py
|
git -C \$repo archive origin/${{ github.ref_name }} -- __init__.py models/ 2>/dev/null | tar -x -C \$sibling/ || true
|
||||||
cp -r /root/rose-ash/\$sibling/models \$sibling/models
|
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
"
|
"
|
||||||
|
|||||||
Reference in New Issue
Block a user