Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: resolve missing output when using --json #4759

Merged
merged 3 commits into from
Jul 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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 })
Copy link
Contributor

Choose a reason for hiding this comment

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

thanks for ordering 😘

}

const { newConfig, configMutations = [] } = await handleBuild({
Expand Down