Exemple #1
0
        public async Task BackupDeployment(int deploymentId)
        {
            Deployment deployment = await _deploymentRepository.GetDeployment(deploymentId);

            if (deployment == null)
            {
                return;
            }

            Server server = await _serverRepository.GetServer(deployment.Server);

            IReadOnlyCollection <Deployment> deployments = await _deploymentRepository.GetServerDeployments(deployment.Server);

            IRemoteClient client = GetClient(server);

            string backupPath = await GetVersionedRemotePath(client, deployment, server.Paths.Backup);

            IReadOnlyCollection <string> skipPaths = deployments
                                                     .Except(new[] { deployment })
                                                     .Select(x => x.RemotePath)
                                                     .ToArray();

            await CopyRemoteFolder(client, deployment.RemotePath, backupPath, skipPaths);
        }
 public async Task <IReadOnlyCollection <Deployment> > GetDeployments(string server)
 {
     return(await _deploymentRepository.GetServerDeployments(server));
 }