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
已提問 4 年前檢視次數 407 次
1 個回答
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
已回答 3 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南