Replaced Console.WriteLog with context.log.
This commit is contained in:
Родитель
27724f04ec
Коммит
bb38c7acea
|
@ -12,7 +12,7 @@ using WebApiRelease = Microsoft.VisualStudio.Services.ReleaseManagement.WebApi.R
|
|||
|
||||
namespace Microsoft.TeamServices.Samples.Client.Release
|
||||
{
|
||||
[ClientSample(ReleaseManagementApiConstants.ReleaseAreaName, ReleaseManagementApiConstants.ReleasesResource)]
|
||||
//[ClientSample(ReleaseManagementApiConstants.ReleaseAreaName, ReleaseManagementApiConstants.ReleasesResource)]
|
||||
public class ManualInterventionSample : ClientSample
|
||||
{
|
||||
private const string releaseDefinitionName = "Fabrikam-web-with-MI";
|
||||
|
@ -104,8 +104,8 @@ namespace Microsoft.TeamServices.Samples.Client.Release
|
|||
this._newlyCreatedRelease1 = ReleasesSample.CreateRelease(releaseClient, _newlyCreatedReleaseDefinitionId, projectName);
|
||||
this._newlyCreatedRelease2 = ReleasesSample.CreateRelease(releaseClient, _newlyCreatedReleaseDefinitionId, projectName);
|
||||
|
||||
Console.WriteLine("{0} {1}", _newlyCreatedRelease1.Id.ToString().PadLeft(6), _newlyCreatedRelease1.Name);
|
||||
Console.WriteLine("{0} {1}", _newlyCreatedRelease2.Id.ToString().PadLeft(6), _newlyCreatedRelease2.Name);
|
||||
Context.Log("{0} {1}", _newlyCreatedRelease1.Id.ToString().PadLeft(6), _newlyCreatedRelease1.Name);
|
||||
Context.Log("{0} {1}", _newlyCreatedRelease2.Id.ToString().PadLeft(6), _newlyCreatedRelease2.Name);
|
||||
}
|
||||
|
||||
[ClientSampleMethod]
|
||||
|
@ -131,7 +131,7 @@ namespace Microsoft.TeamServices.Samples.Client.Release
|
|||
|
||||
foreach (ManualIntervention manualIntervention in manualInterventions)
|
||||
{
|
||||
Console.WriteLine("{0} {1}", manualIntervention.Id.ToString().PadLeft(6), manualIntervention.Name);
|
||||
Context.Log("{0} {1}", manualIntervention.Id.ToString().PadLeft(6), manualIntervention.Name);
|
||||
}
|
||||
|
||||
this._manualInterventions = manualInterventions;
|
||||
|
@ -150,7 +150,7 @@ namespace Microsoft.TeamServices.Samples.Client.Release
|
|||
|
||||
// Get a manual intervention
|
||||
ManualIntervention manualIntervention = releaseClient.GetManualInterventionAsync(project: projectName, releaseId: this._newlyCreatedRelease1.Id, manualInterventionId: this._manualInterventions.FirstOrDefault().Id).Result;
|
||||
Console.WriteLine("{0} {1}", manualIntervention.Id.ToString().PadLeft(6), manualIntervention.Name);
|
||||
Context.Log("{0} {1}", manualIntervention.Id.ToString().PadLeft(6), manualIntervention.Name);
|
||||
|
||||
return manualIntervention;
|
||||
}
|
||||
|
@ -172,7 +172,7 @@ namespace Microsoft.TeamServices.Samples.Client.Release
|
|||
|
||||
// Update a manual intervention
|
||||
ManualIntervention manualIntervention = releaseClient.UpdateManualInterventionAsync(manualInterventionUpdateMetadata: manualInterventionUpdateMetadata, project: projectName, releaseId: this._newlyCreatedRelease1.Id, manualInterventionId: this._manualInterventions.FirstOrDefault().Id).Result;
|
||||
Console.WriteLine("{0} {1}", manualIntervention.Id.ToString().PadLeft(6), manualIntervention.Name);
|
||||
Context.Log("{0} {1}", manualIntervention.Id.ToString().PadLeft(6), manualIntervention.Name);
|
||||
|
||||
return manualIntervention;
|
||||
}
|
||||
|
@ -206,7 +206,7 @@ namespace Microsoft.TeamServices.Samples.Client.Release
|
|||
|
||||
// Update a manual intervention
|
||||
ManualIntervention manualIntervention = releaseClient.UpdateManualInterventionAsync(manualInterventionUpdateMetadata: manualInterventionUpdateMetadata, project: projectName, releaseId: this._newlyCreatedRelease2.Id, manualInterventionId: manualInterventions.FirstOrDefault().Id).Result;
|
||||
Console.WriteLine("{0} {1}", manualIntervention.Id.ToString().PadLeft(6), manualIntervention.Name);
|
||||
Context.Log("{0} {1}", manualIntervention.Id.ToString().PadLeft(6), manualIntervention.Name);
|
||||
|
||||
return manualIntervention;
|
||||
}
|
||||
|
@ -221,8 +221,7 @@ namespace Microsoft.TeamServices.Samples.Client.Release
|
|||
ReleaseHttpClient releaseClient = connection.GetClient<ReleaseHttpClient>();
|
||||
|
||||
// delete release definition
|
||||
releaseClient.DeleteReleaseDefinitionAsync(project: projectName, definitionId: this._newlyCreatedReleaseDefinitionId).SyncResult();
|
||||
|
||||
releaseClient.DeleteReleaseDefinitionAsync(project: projectName, definitionId: this._newlyCreatedReleaseDefinitionId, forceDelete: true).SyncResult();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -88,7 +88,7 @@ namespace Microsoft.TeamServices.Samples.Client.Release
|
|||
|
||||
newlyCreatedReleaseDefinitionId = releaseDefinition.Id;
|
||||
|
||||
Console.WriteLine("{0} {1}", releaseDefinition.Id.ToString().PadLeft(6), releaseDefinition.Name);
|
||||
Context.Log("{0} {1}", releaseDefinition.Id.ToString().PadLeft(6), releaseDefinition.Name);
|
||||
|
||||
return releaseDefinition;
|
||||
}
|
||||
|
@ -105,7 +105,7 @@ namespace Microsoft.TeamServices.Samples.Client.Release
|
|||
// Show a release definitions
|
||||
ReleaseDefinition releaseDefinition = releaseClient.GetReleaseDefinitionAsync(project: projectName, definitionId: newlyCreatedReleaseDefinitionId).Result;
|
||||
|
||||
Console.WriteLine("{0} {1}", releaseDefinition.Id.ToString().PadLeft(6), releaseDefinition.Name);
|
||||
Context.Log("{0} {1}", releaseDefinition.Id.ToString().PadLeft(6), releaseDefinition.Name);
|
||||
|
||||
return releaseDefinition;
|
||||
}
|
||||
|
@ -124,7 +124,7 @@ namespace Microsoft.TeamServices.Samples.Client.Release
|
|||
|
||||
foreach (ReleaseDefinition releaseDefinition in releaseDefinitions)
|
||||
{
|
||||
Console.WriteLine("{0} {1}", releaseDefinition.Id.ToString().PadLeft(6), releaseDefinition.Name);
|
||||
Context.Log("{0} {1}", releaseDefinition.Id.ToString().PadLeft(6), releaseDefinition.Name);
|
||||
}
|
||||
|
||||
return releaseDefinitions;
|
||||
|
@ -144,7 +144,7 @@ namespace Microsoft.TeamServices.Samples.Client.Release
|
|||
|
||||
foreach (ReleaseDefinition releaseDefinition in releaseDefinitions)
|
||||
{
|
||||
Console.WriteLine("{0} {1}", releaseDefinition.Id.ToString().PadLeft(6), releaseDefinition.Name);
|
||||
Context.Log("{0} {1}", releaseDefinition.Id.ToString().PadLeft(6), releaseDefinition.Name);
|
||||
}
|
||||
|
||||
return releaseDefinitions;
|
||||
|
@ -164,7 +164,7 @@ namespace Microsoft.TeamServices.Samples.Client.Release
|
|||
|
||||
foreach (ReleaseDefinition releaseDefinition in releaseDefinitions)
|
||||
{
|
||||
Console.WriteLine("{0} {1}", releaseDefinition.Id.ToString().PadLeft(6), releaseDefinition.Name);
|
||||
Context.Log("{0} {1}", releaseDefinition.Id.ToString().PadLeft(6), releaseDefinition.Name);
|
||||
}
|
||||
|
||||
return releaseDefinitions;
|
||||
|
@ -190,7 +190,7 @@ namespace Microsoft.TeamServices.Samples.Client.Release
|
|||
// update release definition
|
||||
ReleaseDefinition updatedReleaseDefinition = releaseClient.UpdateReleaseDefinitionAsync(project: projectName, releaseDefinition: releaseDefinition).Result;
|
||||
|
||||
Console.WriteLine("{0} {1} {2}", updatedReleaseDefinition.Id.ToString().PadLeft(6), updatedReleaseDefinition.Revision, updatedReleaseDefinition.ModifiedOn);
|
||||
Context.Log("{0} {1} {2}", updatedReleaseDefinition.Id.ToString().PadLeft(6), updatedReleaseDefinition.Revision, updatedReleaseDefinition.ModifiedOn);
|
||||
|
||||
return releaseDefinition;
|
||||
}
|
||||
|
@ -209,7 +209,7 @@ namespace Microsoft.TeamServices.Samples.Client.Release
|
|||
|
||||
foreach (ReleaseDefinitionRevision revision in revisions)
|
||||
{
|
||||
Console.WriteLine("{0} {1} {2} {3}", revision.DefinitionId.ToString().PadLeft(6), revision.Revision, revision.ChangedDate, revision.ChangedBy.DisplayName);
|
||||
Context.Log("{0} {1} {2} {3}", revision.DefinitionId.ToString().PadLeft(6), revision.Revision, revision.ChangedDate, revision.ChangedBy.DisplayName);
|
||||
}
|
||||
|
||||
return revisions;
|
||||
|
@ -226,7 +226,7 @@ namespace Microsoft.TeamServices.Samples.Client.Release
|
|||
|
||||
WebApiRelease release = CreateRelease(releaseClient, newlyCreatedReleaseDefinitionId, projectName);
|
||||
|
||||
Console.WriteLine("{0} {1}", release.Id.ToString().PadLeft(6), release.Name);
|
||||
Context.Log("{0} {1}", release.Id.ToString().PadLeft(6), release.Name);
|
||||
|
||||
return release;
|
||||
}
|
||||
|
@ -247,7 +247,7 @@ namespace Microsoft.TeamServices.Samples.Client.Release
|
|||
// Show a release
|
||||
WebApiRelease release = releaseClient.GetReleaseAsync(project: projectName, releaseId: releaseId).Result;
|
||||
|
||||
Console.WriteLine("{0} {1}", release.Id.ToString().PadLeft(6), release.Name);
|
||||
Context.Log("{0} {1}", release.Id.ToString().PadLeft(6), release.Name);
|
||||
|
||||
return release;
|
||||
}
|
||||
|
@ -266,7 +266,7 @@ namespace Microsoft.TeamServices.Samples.Client.Release
|
|||
// Show the releases
|
||||
foreach (WebApiRelease release in releases)
|
||||
{
|
||||
Console.WriteLine("{0} {1}", release.Id.ToString().PadLeft(6), release.Status);
|
||||
Context.Log("{0} {1}", release.Id.ToString().PadLeft(6), release.Status);
|
||||
}
|
||||
|
||||
return releases;
|
||||
|
@ -285,7 +285,7 @@ namespace Microsoft.TeamServices.Samples.Client.Release
|
|||
// Show releases
|
||||
foreach (WebApiRelease release in releases)
|
||||
{
|
||||
Console.WriteLine("{0} {1} {2}", release.Id.ToString().PadLeft(6), release.Status, release.ReleaseDefinitionReference.Name);
|
||||
Context.Log("{0} {1} {2}", release.Id.ToString().PadLeft(6), release.Status, release.ReleaseDefinitionReference.Name);
|
||||
}
|
||||
|
||||
return releases;
|
||||
|
@ -311,7 +311,7 @@ namespace Microsoft.TeamServices.Samples.Client.Release
|
|||
|
||||
// Start deployment to an environment
|
||||
ReleaseEnvironment releaseEnvironment = releaseClient.UpdateReleaseEnvironmentAsync(releaseEnvironmentUpdateMetadata, projectName, release.Id, releaseEnvironmentId).Result;
|
||||
Console.WriteLine("{0} {1}", releaseEnvironment.Id.ToString().PadLeft(6), releaseEnvironment.Name);
|
||||
Context.Log("{0} {1}", releaseEnvironment.Id.ToString().PadLeft(6), releaseEnvironment.Name);
|
||||
|
||||
return release;
|
||||
}
|
||||
|
@ -335,7 +335,7 @@ namespace Microsoft.TeamServices.Samples.Client.Release
|
|||
|
||||
// Abandon a release
|
||||
WebApiRelease updatedRelease = releaseClient.UpdateReleaseResourceAsync(releaseUpdateMetadata, projectName, release.Id).Result;
|
||||
Console.WriteLine("{0} {1}", updatedRelease.Id.ToString().PadLeft(6), updatedRelease.Name);
|
||||
Context.Log("{0} {1}", updatedRelease.Id.ToString().PadLeft(6), updatedRelease.Name);
|
||||
|
||||
return release;
|
||||
}
|
||||
|
@ -371,7 +371,7 @@ namespace Microsoft.TeamServices.Samples.Client.Release
|
|||
// Show the approvals
|
||||
foreach (ReleaseApproval releaseApproval in releaseApprovals)
|
||||
{
|
||||
Console.WriteLine("{0} {1}", releaseApproval.Id.ToString().PadLeft(6), releaseApproval.Status);
|
||||
Context.Log("{0} {1}", releaseApproval.Id.ToString().PadLeft(6), releaseApproval.Status);
|
||||
}
|
||||
|
||||
return releaseApprovals;
|
||||
|
@ -408,7 +408,7 @@ namespace Microsoft.TeamServices.Samples.Client.Release
|
|||
// Show the approvals
|
||||
foreach (ReleaseApproval releaseApproval in releaseApprovals)
|
||||
{
|
||||
Console.WriteLine("{0} {1}", releaseApproval.Id.ToString().PadLeft(6), releaseApproval.Status);
|
||||
Context.Log("{0} {1}", releaseApproval.Id.ToString().PadLeft(6), releaseApproval.Status);
|
||||
}
|
||||
|
||||
return releaseApprovals;
|
||||
|
@ -449,7 +449,7 @@ namespace Microsoft.TeamServices.Samples.Client.Release
|
|||
// Show the approvals
|
||||
foreach (ReleaseApproval releaseApproval in releaseApprovals)
|
||||
{
|
||||
Console.WriteLine("{0} {1}", releaseApproval.Id.ToString().PadLeft(6), releaseApproval.Status);
|
||||
Context.Log("{0} {1}", releaseApproval.Id.ToString().PadLeft(6), releaseApproval.Status);
|
||||
}
|
||||
|
||||
return releaseApprovals;
|
||||
|
@ -474,7 +474,7 @@ namespace Microsoft.TeamServices.Samples.Client.Release
|
|||
{
|
||||
ReleaseApproval approval = releaseClient.UpdateReleaseApprovalAsync(project: projectName, approval: updateApproval, approvalId: releaseApprovalToApprove.Id).Result;
|
||||
|
||||
Console.WriteLine("{0} {1}", approval.Id.ToString().PadLeft(6), approval.Status);
|
||||
Context.Log("{0} {1}", approval.Id.ToString().PadLeft(6), approval.Status);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -492,7 +492,7 @@ namespace Microsoft.TeamServices.Samples.Client.Release
|
|||
// Show the deployments
|
||||
foreach (Deployment deployment in deployments)
|
||||
{
|
||||
Console.WriteLine("{0} {1}", deployment.Id.ToString().PadLeft(6), deployment.Release.Name);
|
||||
Context.Log("{0} {1}", deployment.Id.ToString().PadLeft(6), deployment.Release.Name);
|
||||
}
|
||||
|
||||
return deployments;
|
||||
|
@ -513,7 +513,7 @@ namespace Microsoft.TeamServices.Samples.Client.Release
|
|||
// Show the deployments
|
||||
foreach (Deployment deployment in deployments)
|
||||
{
|
||||
Console.WriteLine("{0} {1}", deployment.Id.ToString().PadLeft(6), deployment.Release.Name);
|
||||
Context.Log("{0} {1}", deployment.Id.ToString().PadLeft(6), deployment.Release.Name);
|
||||
}
|
||||
|
||||
return deployments;
|
||||
|
|
Загрузка…
Ссылка в новой задаче