Skip to content

Instantly share code, notes, and snippets.

@explorer14
Created July 2, 2018 00:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save explorer14/cda9ec8fd18f03c20ba16a5f781920bc to your computer and use it in GitHub Desktop.
Save explorer14/cda9ec8fd18f03c20ba16a5f781920bc to your computer and use it in GitHub Desktop.
Task("Publish")
.IsDependentOn("Test")
.Does(()=>
{
Information("Publishing LoanRequestRetriever...");
var settingsRetriever = new DotNetCorePublishSettings
{
Configuration = "Release",
OutputDirectory = $"./artifacts/{lrrAppName}",
NoRestore = true
};
DotNetCorePublish("./LoanRequestRetriever/LoanRequestRetriever.csproj", settingsRetriever);
// open the config file
var lrrConfig = File($"./artifacts/{lrrAppName}/{lrrAppName}.exe.config");
// apply the actual dashboard settings
XmlPoke(lrrConfig,
"configuration/appSettings/add[@key='AzureWebJobsDashboard']/@value",
EnvironmentVariable("AzureWebJobsDashboard"));
// apply the actual azure storage settings
XmlPoke(lrrConfig,
"configuration/appSettings/add[@key='AzureWebJobsStorage']/@value",
EnvironmentVariable("AzureWebJobsDashboard"));
// set the schedule time for a timer triggered web job
XmlPoke(lrrConfig,
"configuration/appSettings/add[@key='CronExp']/@value",
EnvironmentVariable("CronExp"));
// Set the Splunk HEC host for logging
XmlPoke(lrrConfig,
"configuration/appSettings/add[@key='SplunkHost']/@value", splunkHost);
// Set the token that will be used with Splunk logging API
XmlPoke(lrrConfig,
"configuration/appSettings/add[@key='LRRToken']/@value", lrrToken);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment