public void SetUp() { threadingPolicy = new SingleThreadingPolicy(); transactionFactory = new TransactionFactory(threadingPolicy); layer = MockRepository.GenerateMock<ILayer>(); serverManager = MockRepository.GenerateMock<IServerManager>(); serverManagerFactory = MockRepository.GenerateMock<IServerManagerFactory>(); operationFactory = new OperationFactory(layer, serverManagerFactory); sut = new Deployer(transactionFactory, operationFactory); project = new Project { Name = "Search.API", Source = @"\\ystage01.ywebfarm.lcl\e$\ServiceArtifacts\Yoox.API\Search.API\1.1_new", Path = @"Test\Yoox.API\Search.API\1.0", Application = "Search.API", Site = "Yoox.API", Servers = new[] { @"\\serverA\", @"\\serverB\" }, }; }
public void Info(IEnumerable<string> servers, Project project, Action<string> callback) { var operations = servers.Select(s => operationFactory.CreateInfoOperation(s, project.Site, project.Application, callback)); using (var transaction = transactionFactory.Create()) { transaction.Execute(operations); } }
public void Push(IEnumerable<string> servers, Project project, int version) { var operations = servers.Select(s => operationFactory.CreatePushOperation(project.Source, GetFullPath(s, project.Path, version))); using (var transaction = transactionFactory.Create()) { transaction.Execute(operations); } }
public void Init(Project project) { var operations = project.Servers.Select(s => operationFactory.CreateInitOperation(s, GetFullPath(s, project.Path, 0), project.Site, project.Application)); using (var transaction = transactionFactory.Create()) { transaction.Execute(operations); } }
public void Switch(IEnumerable<string> servers, Project project, int oldVersion, int newVersion) { var operations = servers.Select(s => operationFactory.CreateSwitchOperation(s, project.Site, project.Application, GetFullPath(s, project.Path, oldVersion), GetFullPath(s, project.Path, newVersion))); using (var transaction = transactionFactory.Create()) { transaction.Execute(operations); } }