Ejemplo n.º 1
0
        public Deployer(Options options, LocalShell localShell, RemoteShell remoteShell)
        {
            this.options     = options;
            this.localShell  = localShell;
            this.remoteShell = remoteShell;

            Program.RegisterForDispose(this);
        }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
#if DEBUG
            //args = new[] { @"..\..\..\sample\deploy" };
            //args = new[] { "--init" };
            //args = new[] { "--help" };
            //args = new[] { "--install" };
            args = new[] { "--version" };
#endif
            if (args.Length == 1 && args[0] == "--init")
            {
                InitConfig.Create();
            }
            else if (args.Length == 1 && args[0] == "--install")
            {
                Installer.Run();
            }
            else if (args.Length == 1 && args[0] == "--version")
            {
                ShowVersion();
            }
            else if (args.Length == 1 && args[0] == "--help")
            {
                ShowHelp();
            }
            else
            {
                var options = Options.Load(args);

                using (var localShell = new LocalShell())
                    using (var remoteShell = new RemoteShell(options))
                        using (var deployer = new Deployer(options, localShell, remoteShell))
                        {
                            deployer.Execute();
                        }
            }
#if DEBUG
            Console.WriteLine("Done!");
#endif
            Exit(0);
        }