Issue
I am trying to deploy and run a simple python application (discord bot) on AWC EC2 through github. I have setup CodeDeploy and CodePipeline
- Do I need the CodeBuild?
- Where do I mention my main.py executable in appspec.yml to run the code?
- What all hooks(BeforeInstall, AfterInstall, ApplicationStart, ApplicationStop) are important in appspec.yml file?
Solution
Do I need the CodeBuild?
Depends on your application. For some it may be required, for others may not.
Where do I mention my main.py executable in appspec.yml to run the code?
appspec.yml
just runs commands in the instance shell. So you execute your main.py
as you would normally run it manually on the instance, e.g.
hooks:
BeforeInstall:
- location: scripts/RynMyPyton.sh
where scripts/RynMyPyton.sh
would be
#!bin/bash
python main.py
What all hooks(BeforeInstall, AfterInstall, ApplicationStart, ApplicationStop) are important in appspec.yml file?
They are explained in here.
Answered By - Marcin