Пример #1
0
        public Task DeployRepository(IDeployable deployable)
        {
            string ApplicationsFolder   = deployable.ApplicationDeploymentLocations();
            string RepositoryFolder     = deployable.RepositoryDeploymentLocations();
            string ApplicationsLocation = deployable.ApplicationsCurrentLocations();
            string RepositoryLocations  = deployable.RepositoryCurrentLocations();
            bool   IsUpdate             = deployable.IsUpdate();

            if (IsUpdate == false)
            {
                if (!Directory.Exists(RepositoryFolder))
                {
                    Directory.CreateDirectory(RepositoryFolder);
                }
                if (!Directory.Exists(ApplicationsFolder))
                {
                    Directory.CreateDirectory(ApplicationsFolder);
                }
                FileSystem.CopyDirectory(ApplicationsLocation, ApplicationsFolder, true);
                FileSystem.CopyDirectory(RepositoryLocations, RepositoryFolder, true);
                return(Task.CompletedTask);
            }
            else
            {
                FileSystem.CopyDirectory(ApplicationsLocation, ApplicationsFolder, true);
                return(Task.CompletedTask);
            }
        }
Пример #2
0
        public void WriteResourceLocations(IDeployable deployable)
        {
            string Database       = $@"Database;{deployable.RepositoryDeploymentLocations()}";
            string FileRepository = $@"FileRepository;{deployable.FileRepositoryDeploymentLocations()}";
            string Application    = $@"Application;{deployable.DocumentRepositoryDeploymentLocation()}";
            string Administration = $@"Administration;{deployable.AdministrationDeploymentLocations()}";

            foreach (var folder in deployable.ResourceFolders())
            {
                using (StreamWriter writer = new StreamWriter(Path.GetFullPath($@"{folder}\ResourceLocations.txt"), false))
                {
                    writer.WriteLine(Database);
                    writer.WriteLine(FileRepository);
                    writer.WriteLine(Application);
                    writer.WriteLine(Administration);
                }
            }
        }