1

How to see the output

ssh user@xx.xx.xx.xx <<'ENDSSH'
set -x -o verbose;
cd /home/user/project
ls -al
docker-compose exec webapp sh -c '. /home/user/app/venv/bin/activate && cd src/ && python manage.py makemigrations'
docker-compose exec webapp sh -c '. /home/user/app/venv/bin/activate && cd src/ && python manage.py migrate'      
set +x
ENDSSH

I see the input device is not a TTY

So how to see the output from the commands

docker-compose exec webapp sh -c '. /home/user/app/venv/bin/activate && cd src/ && python manage.py makemigrations'
docker-compose exec webapp sh -c '. /home/user/app/venv/bin/activate && cd src/ && python manage.py migrate'     
Santhosh
  • 9,965
  • 20
  • 103
  • 243
  • Are you sure that nothing happens? What if you replace the shell command with `echo hi`? – Ali Tou Nov 09 '21 at 09:04
  • I can see some output if i run it on the server directly – Santhosh Nov 09 '21 at 09:05
  • Can you `docker-compose run` migrations in a new container? That could go through an `ENTRYPOINT` wrapper to set up the virtual environment and simplify this a lot. You also might be able to just run migrations from the remote host, or conversely to use the `ENTRYPOINT` wrapper to run them automatically on container startup. – David Maze Nov 09 '21 at 11:17
  • Does this answer your question? [Error "The input device is not a TTY"](https://stackoverflow.com/questions/43099116/error-the-input-device-is-not-a-tty) Specifically, [this answer](https://stackoverflow.com/a/57565119/5747944) regarding using `-T` flag for `docker-compose exec` to disable pseudo-tty allocation. – sytech Nov 10 '21 at 06:39

0 Answers0