From 0633599a00a338ae12c8b43f35d0a99b11f8fe20 Mon Sep 17 00:00:00 2001 From: Nic Date: Sun, 21 Jan 2018 02:03:33 +1100 Subject: [PATCH] feat: Add custom gcp code --- src/nowflow.js | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/nowflow.js b/src/nowflow.js index bab9774..adf74b3 100644 --- a/src/nowflow.js +++ b/src/nowflow.js @@ -8,6 +8,9 @@ const path = require('path') require('colors') const { writeToFile, deleteFile } = require('./utilities').files +const configFileManager = require('./util/config-files') +const gcpDeploy = require('./providers/gcp/deploy') +const awsDeploy = require('./providers/aws/deploy') /*eslint-disable */ const getAbsPath = relativePath => path.join(process.cwd(), relativePath) @@ -228,8 +231,16 @@ const deploy = (env='default', noalias=false) => { .then(() => { if (!nowUpdate.err && !pkgUpdate.err) { try { - if (nowUpdate.hostingType == 'gcp') - require('child_process').execSync('now gcp', { stdio: 'inherit' }) + if (nowUpdate.hostingType == 'gcp') { + const deployConfig = { + config: configFileManager.readConfigFile(), + authConfig: configFileManager.readAuthConfigFile(), + argv: configFileManager.readLocalConfig() + } + gcpDeploy(deployConfig) + + //require('child_process').execSync('now gcp', { stdio: 'inherit' }) + } else require('child_process').execSync('now', { stdio: 'inherit' }) }