diff --git a/package.json b/package.json index 702dc633e3d..37e314e11f8 100644 --- a/package.json +++ b/package.json @@ -31,6 +31,7 @@ "Dan Loewenherz (https://twitter.com/dwlz)", "Daniel Tschinder (https://twitter.com/TschinderDaniel)", "Daniel Woelfel (https://twitter.com/danielwoelfel)", + "Dario De Vito (https://twitter.com/dariodevito)", "Dave Ackerman ", "David Calavera (https://twitter.com/calavera)", "David Lemler (https://twitter.com/davidlemlerm)", diff --git a/src/commands/deploy/deploy.js b/src/commands/deploy/deploy.js index ebe0461ce7a..915c77a08e4 100644 --- a/src/commands/deploy/deploy.js +++ b/src/commands/deploy/deploy.js @@ -37,12 +37,21 @@ const { sitesCreate } = require('../sites') const DEFAULT_DEPLOY_TIMEOUT = 1.2e6 -const triggerDeploy = async ({ api, siteData, siteId }) => { +const triggerDeploy = async ({ api, options, siteData, siteId }) => { try { const siteBuild = await api.createSiteBuild({ siteId }) - log( - `${NETLIFYDEV} A new deployment was triggered successfully. Visit https://app.netlify.com/sites/${siteData.name}/deploys/${siteBuild.deploy_id} to see the logs.`, - ) + if (options.json) { + logJson({ + site_id: siteId, + site_name: siteData.name, + deploy_id: `${siteBuild.deploy_id}`, + logs: `https://app.netlify.com/sites/${siteData.name}/deploys/${siteBuild.deploy_id}`, + }) + } else { + log( + `${NETLIFYDEV} A new deployment was triggered successfully. Visit https://app.netlify.com/sites/${siteData.name}/deploys/${siteBuild.deploy_id} to see the logs.`, + ) + } } catch (error_) { if (error_.status === 404) { error('Site not found. Please rerun "netlify link" and make sure that your site has CI configured.') @@ -553,7 +562,7 @@ const deploy = async (options, command) => { const deployToProduction = options.prod || (options.prodIfUnlocked && !siteData.published_deploy.locked) if (options.trigger) { - return triggerDeploy({ api, siteId, siteData }) + return triggerDeploy({ api, options, siteData, siteId }) } const { newConfig, configMutations = [] } = await handleBuild({