fix: ignore .env in pipelines (#40327)
This commit is contained in:
committed by
GitHub
parent
6c5304980d
commit
24f57ca7c2
@ -1,11 +1,14 @@
|
|||||||
const path = require('path');
|
const path = require('path');
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
|
|
||||||
const envPath = path.resolve(__dirname, '../.env');
|
// PIPELINE_ENV is 'true' in the build pipeline
|
||||||
if (!fs.existsSync(envPath)) {
|
if (process.env.PIPELINE_ENV !== 'true') {
|
||||||
throw Error('.env not found, please copy sample.env to .env.');
|
const envPath = path.resolve(__dirname, '../.env');
|
||||||
|
if (!fs.existsSync(envPath)) {
|
||||||
|
throw Error('.env not found, please copy sample.env to .env.');
|
||||||
|
}
|
||||||
|
require('dotenv').config({ path: envPath });
|
||||||
}
|
}
|
||||||
require('dotenv').config({ path: envPath });
|
|
||||||
|
|
||||||
const {
|
const {
|
||||||
HOME_LOCATION: home,
|
HOME_LOCATION: home,
|
||||||
|
@ -43,6 +43,7 @@ PAYPAL_WEBHOOK_ID=webhook_id_from_paypal_dashboard
|
|||||||
# ---------------------
|
# ---------------------
|
||||||
# Build variants
|
# Build variants
|
||||||
# ---------------------
|
# ---------------------
|
||||||
|
PIPELINE_ENV=false
|
||||||
DEPLOYMENT_ENV='staging'
|
DEPLOYMENT_ENV='staging'
|
||||||
FREECODECAMP_NODE_ENV='development'
|
FREECODECAMP_NODE_ENV='development'
|
||||||
# Language to build
|
# Language to build
|
||||||
|
Reference in New Issue
Block a user