public static object Targets(IParameters parameters) { var stage = parameters.Required <string>("stage"); var machine = parameters.Required <string>("machine"); var deployService = new Copy { FromPath = "service", ToPath = machine.WhenBuilt(m => String.Format(@"c:\deployments\install\{0}\service", m)), }; var deployWeb = new Copy { FromPath = "web", ToPath = machine.WhenBuilt(m => String.Format(@"c:\deployments\install\{0}\web", m)), }; var remoteMachineOne = GetRemoteMachine(stage, machine, "one"); var remoteMachineTwo = GetRemoteMachine(stage, machine, "two"); Task <IEnumerable <RemoteMachine> > serviceMachines = new[] { remoteMachineOne, remoteMachineTwo }; Task <IEnumerable <RemoteMachine> > webMachines = new[] { remoteMachineTwo }; var deployArchive = new StagedDeployArchive(stage, "archive"); var service = deployArchive.Add("service", "service", deployService).WithRemoteDeploy(serviceMachines.SelectTasks(m => m.DeployTargets("Service"))); var web = deployArchive.Add("web", "web", deployWeb).WithRemoteDeploy(webMachines.SelectTasks(m => m.DeployTargets("Web"))); return(new { Service = service, Web = web, }); }
public static object Targets(IParameters parameters) { var stage = parameters.Required<string>("stage"); var machine = parameters.Required<string>("machine"); var deployService = new Copy { FromPath = "service", ToPath = machine.WhenBuilt(m => String.Format(@"c:\deployments\install\{0}\service", m)), }; var deployWeb = new Copy { FromPath = "web", ToPath = machine.WhenBuilt(m => String.Format(@"c:\deployments\install\{0}\web", m)), }; var remoteMachineOne = GetRemoteMachine(stage, machine, "one"); var remoteMachineTwo = GetRemoteMachine(stage, machine, "two"); Task<IEnumerable<RemoteMachine>> serviceMachines = new[] {remoteMachineOne, remoteMachineTwo}; Task<IEnumerable<RemoteMachine>> webMachines = new[] {remoteMachineTwo}; var deployArchive = new StagedDeployArchive(stage, "archive"); var service = deployArchive.Add("service", "service", deployService).WithRemoteDeploy(serviceMachines.SelectTasks(m => m.DeployTargets("Service"))); var web = deployArchive.Add("web", "web", deployWeb).WithRemoteDeploy(webMachines.SelectTasks(m => m.DeployTargets("Web"))); return new { Service = service, Web = web, }; }