AL2 - predeploy script and environment variables

0

Hi,

I'm using a predeploy script (.platform/hooks/predeploy/) to run Django's collectstatic command to bundle up the static assets for my site. Works great. Except it appears to never run if I just update an environment variable either within the AWS console, or via the EB CLI. The environment variable is set, but it looks like my predeploy script is not run and my normally present /static folder with my static assets is not present.

This forces me to run another deploy (eb deploy), which then correctly runs my script. However it means that my website is basically down during the many minutes it takes for a) the environment to update with the new environment variable and b) the environment to update with the follow up deploy.

This is really not good. Any suggestions on how to solve for this? Much appreciated in advance!

jt6677
gefragt vor 4 Jahren407 Aufrufe
1 Antwort
0

Replying to my own post in case it helps someone else.

Solution: copy the predeploy script in .platform/hooks/predeploy into .platform/confighooks/predeploy so that it is also run on configuration changes.

jt6677
beantwortet vor 3 Jahren

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen