public override void Import(IBuildImporterContext context) { var configurer = (TfsConfigurer)this.GetExtensionConfigurer(); string buildNumber = VsoArtifactImporter.DownloadAndImportAsync( configurer, this, this.TeamProject, this.TfsBuildNumber, this.BuildDefinition, new ArtifactIdentifier(context.ApplicationId, context.ReleaseNumber, context.BuildNumber, context.DeployableId, this.ArtifactName) ).Result(); if (this.CreateBuildNumberVariable) { this.LogDebug($"Setting $TfsBuildNumber build variable to {buildNumber}..."); DB.Variables_CreateOrUpdateVariableDefinition( Variable_Name: "TfsBuildNumber", Environment_Id: null, ServerRole_Id: null, Server_Id: null, ApplicationGroup_Id: null, Application_Id: context.ApplicationId, Deployable_Id: null, Release_Number: context.ReleaseNumber, Build_Number: context.BuildNumber, Execution_Id: null, Promotion_Id: null, Value_Text: buildNumber, Sensitive_Indicator: false ); this.LogInformation("$TfsBuildNumber build variable set to: " + buildNumber); } }
protected override void Execute() { var configurer = this.GetExtensionConfigurer(); VsoArtifactImporter.DownloadAndImportAsync( configurer, this, this.TeamProject, this.BuildNumber, this.BuildDefinition, new ArtifactIdentifier(this.Context.ApplicationId, this.Context.ReleaseNumber, this.Context.BuildNumber, this.Context.DeployableId, this.ArtifactName) ).Result(); }