Skip to content

Commit

Permalink
fix: resolve missing output when using --json (#4759)
Browse files Browse the repository at this point in the history
Co-authored-by: Daniel Tschinder <231804+danez@users.noreply.github.com>
  • Loading branch information
dariodevito and danez committed Jul 11, 2022
1 parent 9cefa25 commit 4b4b174
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
1 change: 1 addition & 0 deletions package.json
Expand Up @@ -31,6 +31,7 @@
"Dan Loewenherz <dan@lionheartsw.com> (https://twitter.com/dwlz)",
"Daniel Tschinder (https://twitter.com/TschinderDaniel)",
"Daniel Woelfel <dwwoelfel@gmail.com> (https://twitter.com/danielwoelfel)",
"Dario De Vito <dario.devito@gmail.com> (https://twitter.com/dariodevito)",
"Dave Ackerman <dmackerman@gmail.com>",
"David Calavera <david@netlify.com> (https://twitter.com/calavera)",
"David Lemler <dlemler@pm.me> (https://twitter.com/davidlemlerm)",
Expand Down
19 changes: 14 additions & 5 deletions src/commands/deploy/deploy.js
Expand Up @@ -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.')
Expand Down Expand Up @@ -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({
Expand Down

1 comment on commit 4b4b174

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📊 Benchmark results

Package size: 227 MB

Please sign in to comment.