/// <summary> /// Will iterate through the deploymentComponentGraph and create all required tasks and add them to a DeploymentTaskCollection /// </summary> /// <param name="breakOnError"> </param> /// <param name="deploymentComponentGraph"></param> /// <returns></returns> public static DeploymentTaskCollection Create(bool breakOnError, DeploymentStrategyComponentGraphBase deploymentComponentGraph) { if (deploymentComponentGraph is LocalDeploymentStrategyComponentGraphBase) { return new LocalRegionDeploymentTaskFactory().Create(breakOnError, deploymentComponentGraph as LocalDeploymentStrategyComponentGraphBase); } if (deploymentComponentGraph is RemoteDeploymentStrategyComponentGraphBase) { return new RemoteDeploymentTaskFactory().Create(breakOnError, deploymentComponentGraph as RemoteDeploymentStrategyComponentGraphBase); } throw new ArgumentOutOfRangeException("deploymentComponentGraph"); }
private static void CreateActions(DeploymentStrategyComponentGraphBase deploymentStrategyComponentGraph, ConfigSection deployment, List<string> msdeployLocations) { foreach (ConfigSection section in deployment.Collections.GetCollections()) { if (!section.ContainsKey("ComponentType")) { //ignore sections such as MsDeploy Locations continue; } ActionComponentGraphBase actionComponentGraph; ActionType actionType = TryParseComponentType(section["ComponentType"]); switch (actionType) { case ActionType.FileDeployment: actionComponentGraph = section.Create<FileCopyActionComponentGraph>(); break; case ActionType.FilePermission: actionComponentGraph = section.Create<SetFilePermissionComponentGraph>(); break; case ActionType.AppPoolCreation: case ActionType.AppPoolRemoval: case ActionType.WebSiteCreation: case ActionType.WebsiteRemoval: case ActionType.AppCreation: case ActionType.AppRemoval: actionComponentGraph = section.Create<IisActionComponentGraph>(); break; case ActionType.ApplicationExecution: actionComponentGraph = section.Create<ApplicationExecutionDeploymentComponentGraph>(); break; case ActionType.CreatePackage: actionComponentGraph = section.Create<PackageCreationComponentGraph>(); break; case ActionType.DeployPackage: actionComponentGraph = section.Create<PackageDeploymentComponentGraph>(); break; default: throw new ArgumentOutOfRangeException(); } actionComponentGraph.ActionType = actionType; actionComponentGraph.MsDeployExeLocations.AddRange(msdeployLocations); deploymentStrategyComponentGraph.Actions.Add(actionComponentGraph); } }
private static void UpdateCompoentGraphWithOverLoads(DeploymentStrategyComponentGraphBase deploymentComponentGraph, SwitchParams consoleParams) { foreach (ActionComponentGraphBase action in deploymentComponentGraph.Actions) { if (consoleParams.CleanUp.HasValue) { action.CleanUp = consoleParams.CleanUp.Value; } if (consoleParams.Force.HasValue) { action.ForceInstall = consoleParams.Force.Value; } } }
public static DeploymentTaskCollection Create(DeploymentStrategyComponentGraphBase deploymentComponentGraph) { return Create(false, deploymentComponentGraph); }