Fix migration: use login shell to find node binary in SSM context
Some checks failed
Deploy / detect (push) Successful in 4s
Deploy / deploy-api (push) Failing after 21s
Deploy / tag-deploy (push) Has been cancelled
Deploy / deploy-frontend (push) Has been cancelled

This commit is contained in:
DaX
2026-03-05 01:51:10 +01:00
parent 85481512c8
commit 6d04e16cf6

View File

@@ -145,7 +145,7 @@ jobs:
if: needs.detect.outputs.migrations == 'true' if: needs.detect.outputs.migrations == 'true'
run: | run: |
cat > /tmp/migrate-params.json << 'PARAMS' 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/","sudo -iu ubuntu bash -c '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/","bash -lc 'cd /home/ubuntu/filamenteka-api && node api/migrate.js'"]}
PARAMS PARAMS
CMD_ID=$(aws ssm send-command \ CMD_ID=$(aws ssm send-command \
--region $AWS_REGION \ --region $AWS_REGION \