Comments (3)
Interesting! Did you just add an empty appsettings.json file, or did it contain anything? It looks as though it failed in the deployment pipeline while trying to get a particular value (though it's hard to tell what value). I'm going to move this issue over to Statiq Web since that's where the deployment pipeline lives and continue investigating.
from statiq.web.
Quick question - where are "NetlifySiteId" and "NetlifyAccessToken" defined? I see them being used to configure the Netlify deployment, but where are those values coming from? Were they defined anywhere before you added the appsettings.json file?
from statiq.web.
Ah, I see what's going on here. Basically, the DeployToNetlify()
extension method is intended to specify the actual value of the NetlifySiteId
and NetlifyAccessToken
settings (whether that's directly or via something like a delegate). However, to allow more complicated logic it does take a Config<string>
. Here's the code of that extension, which might make this a little clearer:
public static TBootstrapper DeployToNetlify<TBootstrapper>(
this TBootstrapper bootstrapper,
Config<string> siteId,
Config<string> accessToken)
where TBootstrapper : IBootstrapper =>
bootstrapper
.AddSettingsIfNonExisting(new Dictionary<string, object>
{
{ WebKeys.NetlifySiteId, siteId },
{ WebKeys.NetlifyAccessToken, accessToken }
});
See how it's just calling AddSettingsIfNonExisting()
? When those settings aren't defined elsewhere, the Program.cs
code above ends up adding them as Config.FromSetting<string>("NetlifySiteId")
, etc. So what's happening is that the Netlify deployment module looks for the setting NetlifySiteId
, finds it, and then evaluates the Config.FromSetting<string>("NetlifySiteId")
, which looks for the setting NetlifySiteId
, finds it, etc. on and on. By adding an appsettings.json
file with those values, the AddSettingsIfNonExisting()
sees that they're already defined and doesn't redefine them.
The "solution" here is to either specify the value of these settings directly in the Program.cs
file, or specify them elsewhere like an appsettings.json
file or an environment variable. In other words, you don't need to call DeployToNetlify()
in your Program.cs
at all if those settings are defined somewhere else - Statiq will find them and trigger the deployment if they're available. Think of the DeployToNetlify()
extension not as a "turn it on" switch but as a "configure it" helper if that makes sense.
I'll make a note in the documentation to clarify this for all the deployment pipelines, and I also made a small improvement to how this sort of recursive key expansion is reported so it's clearer. Here's what your scenario (without the appsettings.json
file) would output going forward:
from statiq.web.
Related Issues (20)
- Release 1.0.0-beta.50 is broken with Search Index Generation enabled HOT 3
- Netlify deployment not deploying dot files/directories HOT 7
- Post is published even if the published date is only tomorrow HOT 5
- Statiq.Web.props to Statiq.Web.targets causing compilation issues HOT 2
- How to set FrontMatterRegexes to use custom Frontmatter? HOT 3
- Sitemap is missing lastmod values HOT 4
- LESS: 'background: center/xx' breaks the compilation HOT 4
- Strict run and add document metadata in runtime HOT 1
- RSS missing feed title HOT 4
- Question: Include example HOT 2
- Microsoft.Azure.Search is Deprecated, and has known vulnerabilities
- install pptx HOT 2
- [Bug] Images don't show on post listing HOT 2
- SCSS regeneration is not working when changing imported files HOT 4
- Make sure IsPost gets set correctly for tags and archive pages HOT 1
- Add minification modules as options
- Analyzer warning when using Unicode Tags. HOT 2
- Link validation appears to be flagging mailto links HOT 4
- Hot reload stops working after a compiler error
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from statiq.web.