-
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.
Trying to move var exporting to start file
- Loading branch information
Showing
2 changed files
with
41 additions
and
23 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,39 @@ | ||
#!/bin/sh | ||
# source /app/lagoon/set-env-variables.sh | ||
|
||
# if [ $LAGOON_ENVIRONMENT_TYPE == "production" ]; then | ||
# cd /app | ||
# npm run start | ||
# else | ||
# cd /app | ||
# npm run dev | ||
# fi | ||
getLagoonUrl() { | ||
local type=$1 | ||
|
||
source /app/lagoon/set-env-variables.sh | ||
for route in ${LAGOON_ROUTES//,/ }; do | ||
if echo "$route" | grep -q "$type"; then | ||
echo "$route" | ||
return | ||
fi | ||
done | ||
} | ||
|
||
echo "07:06" | ||
# 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 | ||
|
||
cd /app | ||
# 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" | ||
|
||
printenv | ||
|
||
echo "21:09" | ||
|
||
cd /app || exit 1 | ||
# TODO: Remember to adjust the following line before deploying to production. | ||
# Using `yarn start:with-server-source-maps` is probably adding a performance overhead. | ||
yarn build && yarn start:with-server-source-maps | ||
exit 0; | ||
exit 0 |