Fix migration: use find to locate node binary on EC2
Some checks failed
Deploy / detect (push) Successful in 7s
Deploy / deploy-api (push) Failing after 26s
Deploy / tag-deploy (push) Has been cancelled
Deploy / deploy-frontend (push) Has been cancelled

This commit is contained in:
DaX
2026-03-05 01:53:17 +01:00
parent 6d04e16cf6
commit 11dbea3536

View File

@@ -145,7 +145,7 @@ jobs:
if: needs.detect.outputs.migrations == 'true'
run: |
cat > /tmp/migrate-params.json << 'PARAMS'
{"commands":["set -e","cd /tmp","rm -rf repo.tar.gz filamenteka","curl -sf -o repo.tar.gz https://git.demirix.dev/dax/Filamenteka/archive/main.tar.gz","tar xzf repo.tar.gz","mkdir -p /home/ubuntu/filamenteka-api/api /home/ubuntu/filamenteka-api/database/migrations","cp -r filamenteka/database/* /home/ubuntu/filamenteka-api/database/","cp filamenteka/api/migrate.js /home/ubuntu/filamenteka-api/api/migrate.js","rm -rf repo.tar.gz filamenteka","echo Migration files:","ls -la /home/ubuntu/filamenteka-api/database/migrations/","bash -lc 'cd /home/ubuntu/filamenteka-api && node api/migrate.js'"]}
{"commands":["set -e","cd /tmp","rm -rf repo.tar.gz filamenteka","curl -sf -o repo.tar.gz https://git.demirix.dev/dax/Filamenteka/archive/main.tar.gz","tar xzf repo.tar.gz","mkdir -p /home/ubuntu/filamenteka-api/api /home/ubuntu/filamenteka-api/database/migrations","cp -r filamenteka/database/* /home/ubuntu/filamenteka-api/database/","cp filamenteka/api/migrate.js /home/ubuntu/filamenteka-api/api/migrate.js","rm -rf repo.tar.gz filamenteka","echo Migration files:","ls -la /home/ubuntu/filamenteka-api/database/migrations/","NODE_PATH=$(find /usr /home -name node -type f 2>/dev/null | head -1) && echo Found node at: $NODE_PATH && cd /home/ubuntu/filamenteka-api && $NODE_PATH api/migrate.js"]}
PARAMS
CMD_ID=$(aws ssm send-command \
--region $AWS_REGION \