Esempio n. 1
0
        public void CreateTestEnvironment()
        {
            _surveyDir      = "TestSurvey" + TestUtils.GetPostfix();
            _confSection    = DeployerConfigurationSection.Instance;
            _packageManager = new PackageManager();

            var pathToZipsForTests = _confSection.Settings.Paths.Uploads;

            _pathToFolderForDeploy         = _confSection.Settings.Paths.Surveys;
            _pathToZipForInstall           = Path.Combine(pathToZipsForTests, "TestSurvey.zip");
            _pathToZipForUpdate            = Path.Combine(pathToZipsForTests, "TestSurveyUpd.zip");
            _pathToZipForUpdateOnlyBin     = Path.Combine(pathToZipsForTests, "TestSurveyUpdOnlyBin.zip");
            _pathToZipForUpdateOnlyAppData = Path.Combine(pathToZipsForTests, "TestSurveyUpdOnlyAppData.zip");

            _filesInInstallZip = new List <string>();
            using (var zip = new ZipFile(_pathToZipForInstall)
            {
                UseUnicodeAsNecessary = true
            })
                _filesInInstallZip.AddRange(zip.Select(file => file.FileName));

            Directory.CreateDirectory(_pathToFolderForDeploy);
        }
Esempio n. 2
0
        private void InitializeSettings(DeployerConfigurationSection confSection)
        {
            Credentials = new Credentials(
                confSection.Settings.Credentials.Domain,
                confSection.Settings.Credentials.Login,
                confSection.Settings.Credentials.Password);
            Survey = new Survey(_context.UriName, _context.DatabaseName ?? _context.UriName, _context.Mode);
            var surveyDir = Path.Combine(confSection.Settings.Paths.Surveys, _context.DirectoryName ?? _context.UriName);

            SurveyPath   = new SurveyPaths(surveyDir, () => Path.Combine(surveyDir, "bin"));
            PackagePaths = new PackagePaths(
                Path.Combine(confSection.Settings.Paths.Uploads, _context.UriName + ".zip"),
                Path.Combine(confSection.Settings.Paths.Backups, _context.UriName + ".zip"));
            CommonPaths = new CommonPaths(
                confSection.Settings.Paths.Surveys,
                confSection.Settings.Paths.Uploads,
                confSection.Settings.Paths.Backups);
            DbScriptsPaths = new DbScriptsPaths(
                confSection.Settings.ScriptsPaths.DbCreate,
                confSection.Settings.ScriptsPaths.DbValidate,
                confSection.Settings.ScriptsPaths.DbDelete);
            Templates = new TemplatesPaths(
                confSection.Settings.Templates.ConnectionStrings,
                confSection.Settings.Paths.AdditionalResources.Bins);
            ConnectionStrings = new ConnectionStrings(
                ConfigurationManager.ConnectionStrings["master"].ConnectionString,
                ConfigurationManager.ConnectionStrings["deployer"].ConnectionString);
            IIS = new IISInfo(
                confSection.Settings.IIS.Version,
                confSection.Settings.IIS.Address,
                confSection.Settings.IIS.ApplicationPool,
                confSection.Settings.IIS.DirsWithIISAccess == null
                    ? new List <KeyValuePair <string, string> >()
                    : confSection.Settings.IIS.DirsWithIISAccess.Cast <DirElement>()
                .Select(dir => new KeyValuePair <string, string>(dir.Name, dir.User)));
        }
Esempio n. 3
0
 public UpdateRulesBuilder(DeployerConfigurationSection confSection)
 {
     _confSection = confSection;
     _rules       = BuildRules();
 }
Esempio n. 4
0
 private void InitializeSettings(DeployerConfigurationSection confSection)
 {
     Credentials = new Credentials(
         confSection.Settings.Credentials.Domain,
         confSection.Settings.Credentials.Login,
         confSection.Settings.Credentials.Password);
     Survey = new Survey(_context.UriName, _context.DatabaseName ?? _context.UriName, _context.Mode);
     var surveyDir = Path.Combine(confSection.Settings.Paths.Surveys, _context.DirectoryName ?? _context.UriName);
     SurveyPath = new SurveyPaths(surveyDir, () => Path.Combine(surveyDir, "bin"));
     PackagePaths = new PackagePaths(
         Path.Combine(confSection.Settings.Paths.Uploads, _context.UriName + ".zip"),
         Path.Combine(confSection.Settings.Paths.Backups, _context.UriName + ".zip"));
     CommonPaths = new CommonPaths(
         confSection.Settings.Paths.Surveys,
         confSection.Settings.Paths.Uploads,
         confSection.Settings.Paths.Backups);
     DbScriptsPaths = new DbScriptsPaths(
         confSection.Settings.ScriptsPaths.DbCreate,
         confSection.Settings.ScriptsPaths.DbValidate,
         confSection.Settings.ScriptsPaths.DbDelete);
     Templates = new TemplatesPaths(
         confSection.Settings.Templates.ConnectionStrings,
         confSection.Settings.Paths.AdditionalResources.Bins);
     ConnectionStrings = new ConnectionStrings(
         ConfigurationManager.ConnectionStrings["master"].ConnectionString,
         ConfigurationManager.ConnectionStrings["deployer"].ConnectionString);
     IIS = new IISInfo(
         confSection.Settings.IIS.Version,
         confSection.Settings.IIS.Address,
         confSection.Settings.IIS.ApplicationPool,
         confSection.Settings.IIS.DirsWithIISAccess == null
             ? new List<KeyValuePair<string, string>>()
             : confSection.Settings.IIS.DirsWithIISAccess.Cast<DirElement>()
                 .Select(dir => new KeyValuePair<string, string>(dir.Name, dir.User)));
 }
Esempio n. 5
0
 public UpdateRulesBuilder(DeployerConfigurationSection confSection)
 {
     _confSection = confSection;
     _rules = BuildRules();
 }
Esempio n. 6
0
        public void CreateTestEnvironment()
        {
            _surveyDir = "TestSurvey" + TestUtils.GetPostfix();
            _confSection = DeployerConfigurationSection.Instance;
            _packageManager = new PackageManager();

            var pathToZipsForTests = _confSection.Settings.Paths.Uploads;
            _pathToFolderForDeploy = _confSection.Settings.Paths.Surveys;
            _pathToZipForInstall = Path.Combine(pathToZipsForTests, "TestSurvey.zip");
            _pathToZipForUpdate = Path.Combine(pathToZipsForTests, "TestSurveyUpd.zip");
            _pathToZipForUpdateOnlyBin = Path.Combine(pathToZipsForTests, "TestSurveyUpdOnlyBin.zip");
            _pathToZipForUpdateOnlyAppData = Path.Combine(pathToZipsForTests, "TestSurveyUpdOnlyAppData.zip");

            _filesInInstallZip = new List<string>();
            using (var zip = new ZipFile(_pathToZipForInstall) { UseUnicodeAsNecessary = true })
                _filesInInstallZip.AddRange(zip.Select(file => file.FileName));

            Directory.CreateDirectory(_pathToFolderForDeploy);
        }