public PackagedScriptConvention(string scriptFilePrefix, ICalamariFileSystem fileSystem, IScriptEngineSelector scriptEngineSelector, ICommandLineRunner commandLineRunner)
 {
     this.scriptFilePrefix     = scriptFilePrefix;
     this.fileSystem           = fileSystem;
     this.scriptEngineSelector = scriptEngineSelector;
     this.commandLineRunner    = commandLineRunner;
 }
Beispiel #2
0
 public ConfiguredScriptConvention(string deploymentStage, IScriptEngineSelector scriptEngineSelector,
                                   ICalamariFileSystem fileSystem, ICommandLineRunner commandLineRunner)
 {
     this.deploymentStage      = deploymentStage;
     this.scriptEngineSelector = scriptEngineSelector;
     this.fileSystem           = fileSystem;
     this.commandLineRunner    = commandLineRunner;
 }
 public FeatureScriptConvention(string deploymentStage, ICalamariFileSystem fileSystem, ICalamariEmbeddedResources embeddedResources,
                                IScriptEngineSelector scriptEngineSelector, ICommandLineRunner commandLineRunner)
 {
     this.deploymentStage      = deploymentStage;
     this.fileSystem           = fileSystem;
     this.embeddedResources    = embeddedResources;
     this.scriptEngineSelector = scriptEngineSelector;
     this.commandLineRunner    = commandLineRunner;
 }
        public void SetUp()
        {
            fileSystem           = Substitute.For <ICalamariFileSystem>();
            scriptEngineSelector = Substitute.For <IScriptEngineSelector>();
            scriptEngine         = Substitute.For <IScriptEngine>();
            commandLineRunner    = Substitute.For <ICommandLineRunner>();

            scriptEngineSelector.GetSupportedExtensions().Returns(new string[] { "ps1" });
            scriptEngineSelector.SelectEngine(Arg.Any <string>()).Returns(scriptEngine);

            variables = new VariableDictionary();
            variables.Set(SpecialVariables.Package.EnabledFeatures, SpecialVariables.Features.CustomScripts);

            deployment = new RunningDeployment("C:\\packages", variables)
            {
                StagingDirectory = stagingDirectory
            };
        }
        public void SetUp()
        {
            fileSystem = Substitute.For <ICalamariFileSystem>();
            fileSystem.EnumerateFiles(Arg.Any <string>(), Arg.Any <string[]>()).Returns(new[]
            {
                "C:\\App\\MyApp\\Hello.ps1",
                "C:\\App\\MyApp\\Deploy.ps1",
                "C:\\App\\MyApp\\Deploy.csx",
                "C:\\App\\MyApp\\PreDeploy.ps1"
            });

            commandResult = new CommandResult("PowerShell.exe foo bar", 0, null);
            engine        = Substitute.For <IScriptEngine>();
            engine.Execute(Arg.Any <string>(), Arg.Any <VariableDictionary>(), Arg.Any <ICommandLineRunner>()).Returns(c => commandResult);
            selector = Substitute.For <IScriptEngineSelector>();
            selector.GetSupportedExtensions().Returns(new[] { "csx", "ps1" });
            selector.SelectEngine(Arg.Any <string>()).Returns(engine);
            runner     = Substitute.For <ICommandLineRunner>();
            deployment = new RunningDeployment("C:\\Packages", new VariableDictionary());
        }