When I SSH into my server and run composer install
it works without any issues. However when the command is issued from my CI/CD that would SSH on my server to get the changes I get this error:
jailshell: composer: command not found
How do I fix this?
My CI/CD:
deploy:
stage: deploy
script:
- ssh -tt [email protected]
"cd /path/to/public_html/ &&
git checkout master &&
git pull &&
composer install &&
exit"
Edit
To answer @NicoHaase's question. There was a guide about adding an alias on my .bashrc
but it still didn't work so I ended up downloading composer.phar
and added it to my repository and instead of composer install
, I use php composer.phar install
instead. I mean it works now but that's not the solution to this question so I'm not writing that as an answer.