-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Moving lagoon url environment handling to
yarn start
level
Seems like the only place where we can access the Lagoon env variables is via a script in the node container. We probably have to do this differently with production domains, since we are now matching urls called something with: "nginx", "varnish" and such.
- Loading branch information
Showing
10 changed files
with
34 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
|
||
getLagoonUrl() { | ||
local type=$1 | ||
IFS=',' read -r -a routes <<< "$LAGOON_ROUTES" | ||
for route in "${routes[@]}"; do | ||
if [[ $route == *"$type"* ]]; then | ||
echo "$route" | ||
return | ||
fi | ||
done | ||
} | ||
|
||
# Make sure app.url is set in application | ||
app_url=$(getLagoonUrl node) | ||
if [ -z "$app_url" ]; then | ||
echo "Error: Unable to determine app URL" | ||
exit 1 | ||
fi | ||
|
||
# Make sure the DPL CMS graphql schema endpoint is set in application | ||
cms_url=$(getLagoonUrl nginx) | ||
if [ -z "$cms_url" ]; then | ||
echo "Error: Unable to determine CMS URL" | ||
exit 1 | ||
fi | ||
|
||
|
||
export NEXT_PUBLIC_APP_URL="$app_url" | ||
export NEXT_PUBLIC_GRAPHQL_SCHEMA_ENDPOINT_DPL_CMS="$cms_url/graphql" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,9 @@ | |
# cd /app | ||
# npm run dev | ||
# fi | ||
|
||
source set-env-variables.sh | ||
|
||
printenv | ||
|
||
cd /app | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.