Bamboo itself is running the Flask application and not your system. As a result, the Bamboo build never finishes and all other Bamboo threads related to this build plan are locked. Bamboo tasks will often run until they receive an exit code, which will never happen while your Flask app is running.
Instead of attempting to run the code from Bamboo, you should instead run the flask app outside of bamboo. You can then trigger a reload of your flask app from within Bamboo on source code changes. This will require:
- Have Bamboo detection setup to trigger on code changes (you have this and it sounds like it is working even though it is currently blocked).
- Have a task where you checkout the source code - but check it out to the directory where you are going to be running the Flask app.
- Configure your flask application to watch this source code folder outside of Bamboo. When the source code is updated it will reload the app. The Flask documentation explains this but you can also do it with this one line:
$ FLASK_APP=main.py FLASK_DEBUG=1 python -m flask run
There are several good answers here on SO that go over how to reload your flask app with the latest code changes:
Auto reloading python Flask app upon code changes
How to reload python module in flask?