-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add option to pass arguments in environment variables
varibles names: HISTORYCONTAINERURL, WRITESASTOKEN, REPOSITORYNAME
- Loading branch information
1 parent
da3ae10
commit 624b8db
Showing
6 changed files
with
38 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
src/ReportGenerator.AzureBlobHistoryStorage/EnvironmentVariablesOptionsReader.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
namespace ReportGenerator.AzureBlobHistoryStorage; | ||
|
||
public static class EnvironmentVariablesOptionsReader | ||
{ | ||
public static Dictionary<string, string> ReadOptionsFromEnvironment() | ||
{ | ||
string[] variables = { "HISTORYCONTAINERURL", "WRITESASTOKEN", "REPOSITORYNAME" }; | ||
var res = new Dictionary<string, string>(); | ||
|
||
foreach (string variable in variables) { | ||
string? value = Environment.GetEnvironmentVariable(variable); | ||
|
||
if (string.IsNullOrWhiteSpace(value)) continue; | ||
|
||
res.Add(variable, value); | ||
} | ||
|
||
return res; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters