Skip to content

Commit

Permalink
Roll out debug code and remove feature flags from env files. (#765)
Browse files Browse the repository at this point in the history
  • Loading branch information
timcosgrove authored Oct 1, 2024
1 parent 53d4c67 commit 0cc1105
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 15 deletions.
2 changes: 1 addition & 1 deletion docker-run.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/sh
ls -al envs

APP_ENV=$APP_ENV yarn build:preview && yarn start
4 changes: 2 additions & 2 deletions envs/.env.dev
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ NEXT_PUBLIC_GOOGLE_TAG_MANAGER_AUTH=N9BisSDKAwJENFQtQIEvXQ
NEXT_PUBLIC_GOOGLE_TAG_MANAGER_PREVIEW=env-423

# Feature flags for enabling content types. These should only be added when you are preparing to go to prod and are testing on dev.
FEATURE_NEXT_BUILD_CONTENT_EVENT=true
FEATURE_NEXT_BUILD_CONTENT_EVENT_LISTING=true
# It is better to test these from the CMS backend for dev than here.

4 changes: 0 additions & 4 deletions envs/.env.prod
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,3 @@ NEXT_PUBLIC_GOOGLE_TAG_MANAGER_PREVIEW=env-1
# For example, never add and enable a variable like the following to this file:
# FEATURE_NEXT_BUILD_CONTENT_EVENT=true
# Again, do NOT add these here.

# ... Except, prior to initial launch, we will need these here for prod testing.
FEATURE_NEXT_BUILD_CONTENT_EVENT=true
FEATURE_NEXT_BUILD_CONTENT_EVENT_LISTING=true
3 changes: 1 addition & 2 deletions envs/.env.staging
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,4 @@ NEXT_PUBLIC_GOOGLE_TAG_MANAGER_AUTH=inC4EKQce9vlWpRVcowiyQ
NEXT_PUBLIC_GOOGLE_TAG_MANAGER_PREVIEW=env-661

# Feature flags for enabling content types. These should only be added when you are preparing to go to prod and are testing on staging.
FEATURE_NEXT_BUILD_CONTENT_EVENT=true
FEATURE_NEXT_BUILD_CONTENT_EVENT_LISTING=true
# It is better to test these from the CMS backend for staging than here.
8 changes: 2 additions & 6 deletions packages/env-loader/src/env-file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,17 @@ import { EnvVars } from '.'

const loadEnvVarsFromPath = (path: string): EnvVars => {
const envVars = {}
// eslint-disable-next-line no-console
console.log(`trying to load vars from ${path}`)
dotenvExpand.expand(
dotenv.config({
path: path,
path,
override: true,
processEnv: envVars,
debug: true,
})
)

// eslint-disable-next-line no-console
console.log(`Using environment variables from: ${path}`)
// eslint-disable-next-line no-console
console.log(envVars)

return envVars
}

Expand Down

0 comments on commit 0cc1105

Please sign in to comment.