Error thrown without defined hook
braco opened this issue · comments
Only entered production hook
Plugin was throwing errors and breaking updates
Temporary fix: enter garbage URL for staging
Up voting this issue, I ran into the same exact problem (no need for a staging environment so I didn't configure it). Putting in any old url for staging in the plugin setting fixes this problem.
Right this was the error I was getting #3 (comment)
Never intended this plugin to be used with one environment but no reason it can't be. Easy enough to add some logic here.
@justinwhall , what is the intention of the checkbox on the sidebar of the post/page ? Is it a call to action, to publish to that environment?
Or it is just an indicator to where it is published? Because I checked the code , seems like you intent the latter. However, to a user like me I expect the former.
I am asking so I know what I would do.
Hey @geocine - To me, both scenarios you are describing sound like the same to me :) I assume I'm not following correctly.
Here is what happens:
- If the checkbox is checked, at meta value is added to the post on publish. If it's state it's
lbn_published_stage
if it's prod, it'slbn_published_production
. - Later, when Gatsby builds the site we a var is passed to the build command to tell Gatsby to only build the posts(and pages) the have correct meta value. ie,
DEPLOY_ENV=lbn_published_production gatsby develop
would build prod posts(and pages).
BTW, this plugin now supports only using one build hook.