I'm basically trying to have a heredoc be executed by Flask-migrate's shell with Flask app context
Below is the command i'm trying to run inside my bash script
$ docker exec -it mycontainer ./manage shell <<-EOF
# shell commands to be executed
EOF
When trying to execute the above command I get:
cannot enable tty mode on non tty input
This is the manage file:
#!/usr/bin/env python
from middleware import create_app, config
from middleware.models import db
from flask.ext.script import Manager
from flask.ext.migrate import Migrate, MigrateCommand
app = create_app(config)
migrate = Migrate(app, db)
manager = Manager(app)
manager.add_command('db', MigrateCommand)
if __name__ == '__main__':
manager.run()
My question is there a way to pass set of commands like in heredoc to the shell?