Created
August 7, 2015 06:39
-
-
Save andymac4182/65d8886bd63542bc0a88 to your computer and use it in GitHub Desktop.
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
void Main() | |
{ | |
var server = ""; | |
var apiKey = ""; | |
var endpoint = new OctopusServerEndpoint(server, apiKey); | |
var repository = new OctopusRepository(endpoint); | |
var projectList = repository.Projects.GetAll(); | |
var dumpedVariables = new List<DumpedVariable>(); | |
foreach (var project in projectList) | |
{ | |
var projectDetails = repository.Projects.Get(project.Id); | |
var localVariables = repository.VariableSets.Get(projectDetails.VariableSetId); | |
foreach (var variable in localVariables.Variables) | |
{ | |
dumpedVariables.Add(new UserQuery.DumpedVariable{ProjectName = project.Name, VariableName = variable.Name, Value = variable.Value}); | |
} | |
} | |
dumpedVariables.Where (v => v.Value != null && v.Value.Contains("Data Source")).Dump(); | |
} | |
// Define other methods and classes here | |
class DumpedVariable | |
{ | |
public string ProjectName {get;set;} | |
public string VariableName {get;set;} | |
public string Value {get;set;} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment