Closed JakubKoralewski closed 3 years ago
Thanks for contributing to this issue. As it has been 90 days since the last activity, we are automatically closing the issue. This is often because the request was already solved in some way and it just wasn't updated or it's no longer applicable. If that's not the case, please do feel free to either reopen this issue or open a new one. We'll gladly take a look again! You can read more here: https://blog.travis-ci.com/2018-03-09-closing-old-issues
Feature request
I propose to add to the existing
netlify
deploy configuration the boolean fieldjson
:With this
json
field set totrue
thenetlify deploy
command should add a--json
flag, which returns the following data:The output of the above command should be saved to an environment variable that should be accessible in the
after_deploy
step. Given there could be multiple Netlify website deploys in a single run I propose for the environment variable to be tied to thesite_id
, so that multiple deploys can be accessed independently without one overwriting the other.For example, given the Netlify
site_id
of1234
the environment variable should be calledNETLIFY_DEPLOY_ID_1234
.This will work, because for the deploy to even happen one has to either set the
NETLIFY_SITE
environment variable, or set it in.travis.yml
or in.netlify/state.json
in thesiteId
property; therefore, thesite_id
is always known to the user.The output could be parsed and be output as multiple environment variables, e.g.:
NETLIFY_DEPLOY_ID_1234_SITE_ID
, but I would be against this approach, and instead I'd let the user parse the output themselves usingjq
. This would be easier to implement, and would be one thing less that would have to be updated with each change of the command's output.Motivation
This would allow not setting the
--prod
flag during Netlify deployment, and instead I could access thedeploy_id
inside theafter_deploy
step, then send a notification (whether it would be an email, push notification or slack message) for the admin to confirm the deployment (by using the API restore functionality), view the deployment (using thedeploy_url
property) etc.I like to take a try to implement things myself when I can, but unfortunately I do not know Ruby.