コード例 #1
0
ファイル: BuildTargets.cs プロジェクト: t3hc13h/bounce
        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,
            });
        }
コード例 #2
0
ファイル: BuildTargets.cs プロジェクト: nbucket/bounce
        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,
            };
        }