-
Notifications
You must be signed in to change notification settings - Fork 2k
Closed
Description
Hi all,
I'm not sure this issue is ONTOPIC, I just use some code from your example.
I have some issue to get the process.env from a prepare script in package.json.
I'm trying to run mysql migration before starting the app but I can not fetch the process.env variables
My package.json
...
"scripts": {
...
"prepare": "npm run gcp-build",
"gcp-build": "node migrations.js",
},
...My migrations.js
var path = require('path')
var mysql = require('mysql')
var migration = require('mysql-migrations')
require('dotenv').config()
var connection = mysql.createPool({
connectionLimit: 10,
host: process.env.DB_HOST,
user: process.env.DB_USER,
password: process.env.DB_PASS,
database: process.env.DB_NAME
})
migration.init(connection, path.join(__dirname, '/migrations'))My app read the env_variables from app.yaml without problem but the prepare script do not.
Any help will be appreciated.
Metadata
Metadata
Assignees
Labels
No labels