Skip to content

Commit

Permalink
include new env variables
Browse files Browse the repository at this point in the history
  • Loading branch information
j8seangel committed Dec 4, 2024
1 parent c70d304 commit 4ae45fe
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 10 deletions.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

9 changes: 9 additions & 0 deletions apps/fishing-map/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,16 @@ FROM node:21-alpine AS production
WORKDIR /app

ARG APP_NAME=fishing-map
ARG NEXT_MAP_ERRORS_SPREADSHEET_ID
ARG NEXT_FEEDBACK_SPREADSHEET_ID
ARG NEXT_SPREADSHEET_CLIENT_EMAIL
ARG NEXT_SPREADSHEET_PRIVATE_KEY

ENV APP_NAME $APP_NAME
ENV NEXT_MAP_ERRORS_SPREADSHEET_ID=${NEXT_MAP_ERRORS_SPREADSHEET_ID}
ENV NEXT_FEEDBACK_SPREADSHEET_ID=${NEXT_FEEDBACK_SPREADSHEET_ID}
ENV NEXT_SPREADSHEET_CLIENT_EMAIL=${NEXT_SPREADSHEET_CLIENT_EMAIL}
ENV NEXT_SPREADSHEET_PRIVATE_KEY=${NEXT_SPREADSHEET_PRIVATE_KEY}

ENV NODE_ENV production
# Uncomment the following line in case you want to disable telemetry during runtime.
Expand Down
23 changes: 18 additions & 5 deletions apps/fishing-map/cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,6 @@ steps:
- 'NX_CLOUD_AUTH_TOKEN=$_NX_CLOUD_AUTH_TOKEN'
- 'NEXT_PUBLIC_API_GATEWAY=$_NEXT_PUBLIC_API_GATEWAY'
- 'NEXT_PUBLIC_API_VERSION=$_NEXT_PUBLIC_API_VERSION'
- 'NEXT_PUBLIC_CARRIER_PORTAL_URL=$_NEXT_PUBLIC_CARRIER_PORTAL_URL'
- 'NEXT_MAP_ERRORS_SPREADSHEET_ID=$_NEXT_MAP_ERRORS_SPREADSHEET_ID'
- 'NEXT_FEEDBACK_SPREADSHEET_ID=$_NEXT_FEEDBACK_SPREADSHEET_ID'
- 'NEXT_SPREADSHEET_CLIENT_EMAIL=$_NEXT_SPREADSHEET_CLIENT_EMAIL'
- 'NEXT_SPREADSHEET_PRIVATE_KEY=$_NEXT_SPREADSHEET_PRIVATE_KEY'
- 'NEXT_PUBLIC_GOOGLE_MEASUREMENT_ID=$_NEXT_PUBLIC_GOOGLE_MEASUREMENT_ID'
- 'NEXT_PUBLIC_GOOGLE_TAG_MANAGER_ID=$_NEXT_PUBLIC_GOOGLE_TAG_MANAGER_ID'
- 'NEXT_PUBLIC_LATEST_CARRIER_DATASET_ID=$_NEXT_PUBLIC_LATEST_CARRIER_DATASET_ID'
Expand All @@ -73,6 +68,7 @@ steps:
env:
- 'REF_NAME=$REF_NAME'
- 'SHORT_SHA=$SHORT_SHA'
- 'NEXT_PUBLIC_CARRIER_PORTAL_URL=$_NEXT_PUBLIC_CARRIER_PORTAL_URL'
script: |
image_version=`echo $REF_NAME | grep -Eo "(develop)" || echo $REF_NAME | grep -Eo "fishing-map@([0-9].*)" | grep -Eo "([0-9].*)" || echo $SHORT_SHA`
/kaniko/executor \
Expand All @@ -82,6 +78,14 @@ steps:
--cache=true \
--build-arg \
APP_NAME=fishing-map \
--build-arg \
NEXT_MAP_ERRORS_SPREADSHEET_ID=${_NEXT_MAP_ERRORS_SPREADSHEET_ID} \
--build-arg \
NEXT_FEEDBACK_SPREADSHEET_ID=${_NEXT_FEEDBACK_SPREADSHEET_ID} \
--build-arg \
NEXT_SPREADSHEET_CLIENT_EMAIL=${_NEXT_SPREADSHEET_CLIENT_EMAIL} \
--build-arg \
NEXT_SPREADSHEET_PRIVATE_KEY=${_NEXT_SPREADSHEET_PRIVATE_KEY} \
--target \
production \
-f \
Expand All @@ -97,6 +101,7 @@ steps:
env:
- '_RUN_SERVICE_NAME=$_RUN_SERVICE_NAME'
- '_NEXT_PUBLIC_WORKSPACE_ENV=$_NEXT_PUBLIC_WORKSPACE_ENV'
- 'NEXT_PUBLIC_CARRIER_PORTAL_URL=$_NEXT_PUBLIC_CARRIER_PORTAL_URL'
args:
- '-eEuo'
- 'pipefail'
Expand All @@ -119,6 +124,14 @@ steps:
BASIC_AUTH_USER=$_BASIC_AUTH_USER \
--set-env-vars \
BASIC_AUTH_PASS=$_BASIC_AUTH_PASS \
--set-env-vars \
NEXT_MAP_ERRORS_SPREADSHEET_ID=${_NEXT_MAP_ERRORS_SPREADSHEET_ID} \
--set-env-vars \
NEXT_FEEDBACK_SPREADSHEET_ID=${_NEXT_FEEDBACK_SPREADSHEET_ID} \
--set-env-vars \
NEXT_SPREADSHEET_CLIENT_EMAIL=${_NEXT_SPREADSHEET_CLIENT_EMAIL} \
--set-env-vars \
NEXT_SPREADSHEET_PRIVATE_KEY=${_NEXT_SPREADSHEET_PRIVATE_KEY} \
--allow-unauthenticated
workspace_env=${_NEXT_PUBLIC_WORKSPACE_ENV:-'development'}
echo "https://globalfishingwatch.org/map" > app_url
Expand Down
12 changes: 7 additions & 5 deletions nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,12 @@
"echo $NEXT_PUBLIC_URL",
"echo $NEXT_PUBLIC_API_GATEWAY",
"echo $NEXT_PUBLIC_WORKSPACE_ENV",
"echo $NEXT_PUBLIC_REPORT_DAYS_LIMIT",
"echo $NEXT_PUBLIC_GOOGLE_MEASUREMENT_ID",
"echo $NEXT_PUBLIC_GOOGLE_TAG_MANAGER_KEY",
"echo $NEXT_PUBLIC_GOOGLE_ANALYTICS_TEST_MODE",
"echo $NEXT_PUBLIC_CARRIER_PORTAL_URL",
"echo $NEXT_PUBLIC_LATEST_CARRIER_DATASET_ID",
"echo $NEXT_MAP_ERRORS_SPREADSHEET_ID",
"echo $NEXT_FEEDBACK_SPREADSHEET_ID",
"echo $NEXT_SPREADSHEET_CLIENT_EMAIL",
"echo $NEXT_SPREADSHEET_PRIVATE_KEY"
"echo $NEXT_PUBLIC_LATEST_CARRIER_DATASET_ID"
],
"canTrackAnalytics": false,
"showUsageWarnings": true
Expand Down Expand Up @@ -61,6 +58,11 @@
"dependsOn": ["^build"],
"outputs": ["{projectRoot}/dist"],
"cache": true
},
"dist": {
"dependsOn": ["^dist"],
"outputs": ["{projectRoot}/dist"],
"cache": true
}
},
"generators": {
Expand Down

0 comments on commit 4ae45fe

Please sign in to comment.