Types of command to start an application using CodeDeploy

0

Hello, I'm using CodeDeploy and CodePipeline to deploy my back-end Python Flask application on an EC2 instance with Github connection. Usually, to start the app locally I will use this command in the terminal:

uwsgi --ini myapp:app_var_name

My problem is that when I do this, the step "Application start" in the CodeDeploy "deployment" stage runs infinitely, until a timeout error happens that stops the pipeline. I confirmed the fact that the application was launched by sending a request to the public address.

What kind of command line should I write to avoid any CodeDeploy stage to timeout? Does adding & to the command line enough?

RabahO
asked 2 years ago607 views
1 Answer
0

Your task for "Application Start" hook requires to be finished after it start the application service.

https://docs.aws.amazon.com/codedeploy/latest/userguide/reference-appspec-file-structure-hooks.html#appspec-hooks-server

For the uWSGI server that you use, it can be run through service manager like systemd. You should make the service to be stopped before the installation and start the service again after the deployment.

Please check following uWSGI document for more information.

https://uwsgi-docs.readthedocs.io/en/latest/Management.html

AWS
answered 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions