Elastic BeanStalk post deploy hook not executed

Viewed 154

I'm facing a similar issue to this question while trying to implement the new hooks logic on a AWS Linux 2 managed platform running Docker.

I have created my file inside this .platform/hooks/postdeploy/configure_nginx.sh

which is living in the src/ folder of my app.

I can see the file in my host after the deploy but it's never executed /var/app/current/src/.platform/hooks/postdeploy/configure_nginx.sh

It has the right privileges and I can run it if I ssh into my instance.

The EBS environment is initialized through a docker-compose file where I start 2 public containers and my custom app (in which I have put the hook folders)

The script is not being executed so I'm a bit lost on where I need to put it. FYI, my eb deploy is simply copying a Dockerrun file which is grabbing an image from one of my ECR so basically nothing is done in there.

Thanks for your help!

[SOLUTION] I've found how it should work.

You have to create the .platform folder at the same level as the .ebextensions one. In my case I'm deploying a zip archive simply containing my Dockerrun.aws.json and both .ebextensions and .platform folders. So remember to zip it with the whole package before deploying it to your EBS environment.

0 Answers
Related