Example #1
0
        public override AsimovTask GetTask(DeployUnit unit, AsimovUser user, string correlationId)
        {
            if (!(unit is ICanBeStopStarted))
            {
                throw new ArgumentException("Action is only supported for deploy units that implement ICanBeStopStarted");
            }

            return(((ICanBeStopStarted)unit).GetStopTask());
        }
        public DeployTask(DeployUnit deployUnit, AsimovVersion version, ParameterValues parameterValues, AsimovUser user)
        {
            _deployUnit      = deployUnit;
            _version         = version;
            _parameterValues = parameterValues;
            _user            = user;

            AddDeployStep <CleanTempFolder>();
            AddDeployStep <CopyPackageToTempFolder>();
        }
Example #3
0
        private void Init()
        {
            var targetPath         = Path.Combine(_pluginPath, _packageName + "." + _packageVersion);
            var plugDir            = new FileInfo(targetPath).Directory;
            var catalogs           = plugDir.GetDirectories("*", SearchOption.AllDirectories).Select(x => new DirectoryCatalog(x.FullName));
            var directoryAggregate = new AggregateCatalog(catalogs);

            _container = new CompositionContainer(directoryAggregate);
            _container.ComposeParts(this);
            _node = _exports.First();
        }
Example #4
0
        public PackageSource GetPackageSourceFor(DeployUnit deployUnit)
        {
            var matchingPackageSources = PackageSources.Where(x => x.Name == deployUnit.PackageInfo.Source).ToList();

            if (matchingPackageSources.Count == 0)
            {
                throw new ConfigurationErrorsException($"The package source {deployUnit.PackageInfo.Source}, used by the deploy unit {deployUnit.Name}, does not exist");
            }
            if (matchingPackageSources.Count > 1)
            {
                throw new ConfigurationErrorsException($"The package source {deployUnit.PackageInfo.Source}, used by the deploy unit {deployUnit.Name}, is declared more than once.");
            }
            return(matchingPackageSources.Single());
        }
        public override AsimovTask GetTask(DeployUnit unit, AsimovUser user, string correlationId)
        {
            var previousversion = unit.GetDeployedVersions().Skip(1).FirstOrDefault(x => x.DeployFailed == false);

            if (previousversion == null)
            {
                Log.Warn("Could not find any previous version!");
                return(null);
            }

            var config = ObjectFactory.GetInstance <IAsimovConfig>();

            var packageSource = config.GetPackageSourceFor(unit);
            var version       = packageSource.GetVersion(previousversion.VersionId, unit.PackageInfo);

            return(unit.GetDeployTask(version, new ParameterValues(previousversion.Parameters), user, correlationId));
        }
        private static void AddScriptsDir(string configDir, DeployUnit config)
        {
            var installable = config as IInstallable;

            if (installable?.Installable == null)
            {
                return;
            }
            if (!string.IsNullOrEmpty(installable.Installable.ScriptsDir))
            {
                return;
            }
            var scriptsDir = Path.Combine(configDir, "scripts");

            if (Directory.Exists(scriptsDir))
            {
                installable.Installable.ScriptsDir = Path.GetFullPath(scriptsDir);
            }
        }
Example #7
0
 public PackageSource GetPackageSourceFor(DeployUnit deployUnit)
 => PackageSources.Single(x => x.Name == deployUnit.PackageInfo.Source);
Example #8
0
 public CommandTask(DeployUnit deployUnit, string command)
 {
     this.deployUnit = deployUnit;
     this.command    = command;
 }
 public override AsimovTask GetTask(DeployUnit unit, AsimovUser user, string correlationId)
 {
     return(new VerifySiteTask((WebSiteDeployUnit)unit, Urls.ToArray(), correlationId));
 }
 public PackageSource GetPackageSourceFor(DeployUnit deployUnit)
 {
     return PackageSources.Single(x => x.Name == deployUnit.PackageInfo.Source);
 }
Example #11
0
 public abstract AsimovTask GetTask(DeployUnit unit, AsimovUser user, string correlationId);
 private void Init()
 {
     var targetPath = Path.Combine(_pluginPath, _packageName + "." + _packageVersion);
     var plugDir = new FileInfo(targetPath).Directory;
     var catalogs = plugDir.GetDirectories("*", SearchOption.AllDirectories).Select(x => new DirectoryCatalog(x.FullName));
     var directoryAggregate = new AggregateCatalog(catalogs);
     _container = new CompositionContainer(directoryAggregate);
     _container.ComposeParts(this);
     _node = _exports.First();
 }
 public PowershellUninstallTask(InstallableConfig config, DeployUnit unit, Dictionary <string, object> unitParameters)
 {
     _installableConfig = config;
     _unit           = unit;
     _unitParameters = unitParameters;
 }
 public override AsimovTask GetTask(DeployUnit unit, AsimovUser user)
 {
     return(new CommandTask(unit, Command));
 }
 public override AsimovTask GetTask(DeployUnit unit, AsimovUser user)
 {
     return(new VerifyCommandTask((WebSiteDeployUnit)unit, ZipPath, Command));
 }
 public override AsimovTask GetTask(DeployUnit unit, AsimovUser user)
 {
     return(new PowershellCommandTask(Arguments));
 }
 public override AsimovTask GetTask(DeployUnit unit, AsimovUser user, string correlationId)
 {
     return(new PowershellCommandTask(Arguments, correlationId));
 }
 public override AsimovTask GetTask(DeployUnit unit, AsimovUser user, string correlationId)
 {
     return(new CommandTask(unit, Command, correlationId));
 }
 public override AsimovTask GetTask(DeployUnit unit, AsimovUser user, string correlationId)
 {
     return(new VerifyCommandTask((WebSiteDeployUnit)unit, ZipPath, Command, correlationId));
 }
Example #20
0
 public CommandTask(DeployUnit deployUnit, string command, string correlationId)
 {
     this.deployUnit    = deployUnit;
     this.command       = command;
     this.correlationId = correlationId;
 }
 public abstract AsimovTask GetTask(DeployUnit unit, AsimovUser user);
Example #22
0
 public override AsimovTask GetTask(DeployUnit unit, AsimovUser user)
 {
     return(new VerifySiteTask((WebSiteDeployUnit)unit, Urls.ToArray()));
 }