1
votes

I am trying to deploy and run a simple python application (discord bot) on AWC EC2 through github. I have setup CodeDeploy and CodePipeline

  1. Do I need the CodeBuild?
  2. Where do I mention my main.py executable in appspec.yml to run the code?
  3. What all hooks(BeforeInstall, AfterInstall, ApplicationStart, ApplicationStop) are important in appspec.yml file?
1

1 Answers

2
votes

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.