public void Handle(VSTSRelease_v1 vstsRelease) { var client = new VSTSClient { Connection = new VSTSConnection { Account = vstsRelease.Account, Project = vstsRelease.Project, UserName = vstsRelease.UserName, Password = vstsRelease.Password, } }; if (vstsRelease.DefinitionId == null) { var definition = client.GetReleaseDefinitionAsync(vstsRelease.ReleaseDefinitionName).Result; vstsRelease.DefinitionId = definition.Id; } var latestRelease = client.GetLatestReleaseAsync(vstsRelease.DefinitionId.Value).Result; var releaseDetails = client.GetReleaseDetailsAsync(latestRelease.Id).Result; RemoveEnvironments(vstsRelease, releaseDetails); AddEnvironments(vstsRelease, releaseDetails); }
public void Handle(VSTSBuild_v1 vstsBuild) { var client = new VSTSClient { Connection = new VSTSConnection { Account = vstsBuild.Account, Project = vstsBuild.Project, UserName = vstsBuild.UserName, Password = vstsBuild.Password, } }; if (vstsBuild.DefinitionId == null) { var definition = client.GetBuildDefinitionAsync(vstsBuild.DefinitionName).Result; vstsBuild.DefinitionId = definition.Id; } var latestBuild = client.GetLatestBuildAsync(vstsBuild.DefinitionId.Value).Result; vstsBuild.State = latestBuild.State; }