-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
yarn rw deploy serverless --first-run uses old API_URL #5785
Comments
Additional verification: In your deployed app's directory, use |
Hypothesis: The first-run process relies on reloading the environment via dotenv-default. See
|
Adding to core team discussion queue - as it seems like a fundamental difference in philosophy using dotenv defaults. Desired behaviour: if I supply an env var in my Thank you @joconor for reporting, and the analysis here. |
Been doing some digging on this and can confirm it doesn't work. Effectively, only the Also, this is a close duplicate of #4548 I suggest the way forward here is to remove the .env.production usage entirely from both the --first-run process and the Deploy Serverless documentation |
When deploying to AWS via the Serverless framework, the
--first-run
flag is used to instruct the deployment to create the linkage from the web side to the api side using API_URL. API_URL is not set until after the api side is successfully deployed, at which time the web side knows where to find the api.However, if API_URL is already set, likely from a prior deploy, even though API_URL is overwritten, the web side is deployed using the prior value of API_URL
Steps to reproduce:
Prerequisites:
yarn rw setup deploy serverless
has previously been run successfully.env.production
withAPI_URL
does not exist and API_URL is not set elsewhere in the environmentyarn rw deploy serverless --first-run
, answery
when prompted to Add API_URL to your .env.production.env.production
has been created andAPI_URL
set in that file. Take note of the value of API_URLapi
and performyarn serverless remove --stage production
(Note: AWS keys need to be set in shell environment for this)web
and performyarn serverless remove --stage production
(Note: AWS keys need to be set in shell environment for this)yarn rw deploy serverless --first-run
, answery
when prompted to Add API_URL to your .env.productionAPI_URL
in.env.production
has changedgraphql
endpoint) will failThe text was updated successfully, but these errors were encountered: