Exemple #1
0
        public override void ExecuteTask(Core.IContext ctx)
        {
            try
            {
                Repository source = null;

                using (var rs = new RepositoryStorage())
                {
                    source = rs.GetByAlias(Source);
                }

                var engine = new RevisionPackaging(Revision);
                engine.Source = source;

                engine.StoredItem += new EventHandler<ItemEventArgs>(engine_StoredItem);
                engine.SkippedItem += new EventHandler<ItemEventArgs>(engine_SkippedItem);

                _ctx.Important("Loading manifest...");
                var manifest = RevisionManifest.Load(Manifest);
                engine.AddToQueue(manifest);

                _ctx.Important("Starting packaging...");
                engine.Package();
                engine.Dispose();

                _ctx.Success("All done, yay!");
            }
            catch (Exception ex)
            {
                _ctx.Error(ex);
            }
        }
Exemple #2
0
        protected override void ExecuteTask()
        {
            Console.WriteLine("Application: " + application);
            Console.WriteLine("Config: " + Config);
            Console.WriteLine("plugins: " + plugins);

            init();

            Repository target = null;
            Repository source = null;

            using (var rs = new RepositoryStorage()){
                source = rs.GetByAlias(Source);

                if (!string.IsNullOrEmpty(Target))
                {
                    target = rs.GetByAlias(Target);
                }
            }

            var engine = new RevisionPackaging(Revision);

            engine.Source = source;


            engine.StoredItem  += new EventHandler <ItemEventArgs>(engine_StoredItem);
            engine.SkippedItem += new EventHandler <ItemEventArgs>(engine_SkippedItem);

            if (target != null)
            {
                Console.WriteLine("Enabling compare....");
                engine.EnableInstantCompare(target);
            }

            Console.WriteLine("Loading manifest...");
            var manifest = RevisionManifest.Load(Manifest);

            engine.AddToQueue(manifest);

            Console.WriteLine("Starting packaging...");
            engine.Package();
            engine.Dispose();

            Console.ResetColor();

            Console.WriteLine("All done, yay!");
        }
Exemple #3
0
        protected override void ExecuteTask()
        {
            Console.WriteLine("Application: " + application);
            Console.WriteLine("Config: " + Config);
            Console.WriteLine("plugins: " + plugins);

            init();

            Repository target = null;
            Repository source = null;

            using(var rs = new RepositoryStorage()){
                source = rs.GetByAlias(Source);

                if(!string.IsNullOrEmpty(Target))
                    target = rs.GetByAlias(Target);
            }

            var engine = new RevisionPackaging(Revision);
            engine.Source = source;

            engine.StoredItem += new EventHandler<ItemEventArgs>(engine_StoredItem);
            engine.SkippedItem += new EventHandler<ItemEventArgs>(engine_SkippedItem);

            if (target != null)
            {
                Console.WriteLine("Enabling compare....");
                engine.EnableInstantCompare(target);
            }

            Console.WriteLine("Loading manifest...");
            var manifest = RevisionManifest.Load( Manifest );
            engine.AddToQueue(manifest);

            Console.WriteLine("Starting packaging...");
            engine.Package();
            engine.Dispose();

            Console.ResetColor();

            Console.WriteLine("All done, yay!");
        }
Exemple #4
0
        protected override void ExecuteTask()
        {
            Console.WriteLine("Application: " + application);
            Console.WriteLine("Config: " + Config);
            Console.WriteLine("plugins: " + plugins);

            init();

            RepositoryStorage rs = new RepositoryStorage();
            var r = rs.GetByAlias(Target);

            rs.Dispose();

            var engine = new RevisionExtraction(Revision);

            engine.Destination    = r;
            engine.ExtractedItem += new EventHandler <ItemEventArgs>(engine_ExtractedItem);
            engine.Extract();

            engine.Dispose();

            Console.WriteLine("All done, yay!");
        }
Exemple #5
0
        static void Deploy(IEnumerable <RevisionSetting> revisions)
        {
            try
            {
                Console.WriteLine("Loading extraction instance");

                ExtractionManager manager = ExtractionManager.Instance;
                RepositoryStorage rs      = new RepositoryStorage();

                manager.ExtractedItem += new EventHandler <ItemEventArgs>(manager_ExtractedItem);
                manager.Extracted     += new EventHandler <ExtractionEventArgs>(manager_Extracted);

                manager.OverwriteExistingDependencies = true;
                manager.OverwriteExistingitems        = true;
                manager.OverwriteExistingResources    = true;

                Console.WriteLine("Deployment manager loaded");


                foreach (var rev in revisions.Where(x => x.Active))
                {
                    string revFolder = Path.GetFullPath(rev.Folder);
                    Console.WriteLine("Loading folder: " + revFolder);

                    Repository r = rs.GetByAlias(rev.Alias);

                    /*
                     * Console.WriteLine("Syncing files");
                     * foreach (var s in rev.Syncs)
                     * {
                     *  string pattern = "*.*";
                     *  if (!string.IsNullOrEmpty(s.Pattern))
                     *      pattern = s.Pattern;
                     *
                     *  var files = System.IO.Directory.GetFiles(s.Target, pattern);
                     * }
                     */


                    Console.WriteLine("Enabling remote deployment for: " + r.Name);
                    manager.EnableRemoteExtraction(r);

                    Console.WriteLine("Loading Contents: " + revFolder);
                    manager.Load(revFolder);

                    Console.WriteLine("Building graph...");
                    manager.BuildGraph();

                    Console.WriteLine(manager.ExtractionGraph.CountUnique() + " Items added to graph");

                    Console.WriteLine("Extraction...");
                    manager.ExtractAll(true, true);

                    Console.WriteLine("Unloading...");
                    manager.Unload();
                }

                Console.WriteLine("DONE...");
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.ToString());
            }
        }
Exemple #6
0
        protected override void ExecuteTask()
        {
            Console.WriteLine("Application: " + application);
            Console.WriteLine("Config: " + Config);
            Console.WriteLine("plugins: " + plugins);

            init();

            RepositoryStorage rs = new RepositoryStorage();
            var r = rs.GetByAlias(Target);
            rs.Dispose();

            var engine = new RevisionExtraction(Revision);
            engine.Destination = r;
            engine.ExtractedItem += new EventHandler<ItemEventArgs>(engine_ExtractedItem);
            engine.Extract();

            engine.Dispose();

            Console.WriteLine("All done, yay!");
        }
Exemple #7
0
        static void Deploy(IEnumerable<RevisionSetting> revisions)
        {
            try
            {
                Console.WriteLine("Loading extraction instance");

                ExtractionManager manager = ExtractionManager.Instance;
                RepositoryStorage rs = new RepositoryStorage();

                manager.ExtractedItem += new EventHandler<ItemEventArgs>(manager_ExtractedItem);
                manager.Extracted += new EventHandler<ExtractionEventArgs>(manager_Extracted);

                manager.OverwriteExistingDependencies = true;
                manager.OverwriteExistingitems = true;
                manager.OverwriteExistingResources = true;

                Console.WriteLine("Deployment manager loaded");

                foreach (var rev in revisions.Where(x => x.Active))
                {
                    string revFolder = Path.GetFullPath(rev.Folder);
                    Console.WriteLine("Loading folder: " + revFolder);

                    Repository r = rs.GetByAlias(rev.Alias);

                    /*
                    Console.WriteLine("Syncing files");
                    foreach (var s in rev.Syncs)
                    {
                        string pattern = "*.*";
                        if (!string.IsNullOrEmpty(s.Pattern))
                            pattern = s.Pattern;

                        var files = System.IO.Directory.GetFiles(s.Target, pattern);
                    }
                    */

                    Console.WriteLine("Enabling remote deployment for: " + r.Name);
                    manager.EnableRemoteExtraction(r);

                    Console.WriteLine("Loading Contents: " + revFolder);
                    manager.Load(revFolder);

                    Console.WriteLine("Building graph...");
                    manager.BuildGraph();

                    Console.WriteLine(manager.ExtractionGraph.CountUnique() + " Items added to graph");

                    Console.WriteLine("Extraction...");
                    manager.ExtractAll(true, true);

                    Console.WriteLine("Unloading...");
                    manager.Unload();
                }

                Console.WriteLine("DONE...");
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.ToString());
            }
        }