public static async Task <EnsureAgentResult> EnsureThereIsAnAgentAsync(int pipelinesPoolId, string terraformWorkspaceId, string message) { EnsureInitialization(); var result = new EnsureAgentResult(); result.ThereWasAnUnfinishedApply = await TerraformHelper.ThereIsAnUnfinishedRun(terraformWorkspaceId, isDestroy : false); result.ThereWasAnAgent = await PipelinesHelper.ThereIsARunningAgentAsync(pipelinesPoolId); if (result.ThereWasAnUnfinishedApply || result.ThereWasAnAgent) { return(result); } var tfResponse = await TerraformHelper.CreateRunAsync(terraformWorkspaceId, message, isDestroy : false); result.RunId = tfResponse.Data.Id; return(result); }
public static async Task <bool> ThereIsAPipelineAgentRunning(int pipelinesPoolId) { EnsureInitialization(); return(await PipelinesHelper.ThereIsARunningAgentAsync(pipelinesPoolId)); }