Fix migration step: run node as ubuntu user for correct PATH
Some checks failed
Deploy / detect (push) Successful in 4s
Deploy / deploy-api (push) Failing after 14s
Deploy / deploy-frontend (push) Successful in 2m6s
Deploy / tag-deploy (push) Has been skipped

SSM runs as root with minimal PATH. Use sudo -iu ubuntu to get the
ubuntu user's login shell environment where node is available.
This commit is contained in:
DaX
2026-03-05 01:46:16 +01:00
parent f929c384c1
commit 1e95455139

View File

@@ -160,7 +160,7 @@ jobs:
"rm -rf repo.tar.gz filamenteka", "rm -rf repo.tar.gz filamenteka",
"echo Migration files:", "echo Migration files:",
"ls -la /home/ubuntu/filamenteka-api/database/migrations/", "ls -la /home/ubuntu/filamenteka-api/database/migrations/",
"export NVM_DIR=/home/ubuntu/.nvm && . $NVM_DIR/nvm.sh && cd /home/ubuntu/filamenteka-api && node api/migrate.js" "sudo -iu ubuntu bash -c 'cd /home/ubuntu/filamenteka-api && node api/migrate.js'"
]' \ ]' \
--output json \ --output json \
--query "Command.CommandId" --output text) --query "Command.CommandId" --output text)