Ejemplo n.º 1
0
        public static void Main(string[] args)
        {
            var location    = args[0];
            var projectName = args.Length > 1 ? args[1] : null;

            PackagingManager.Distribute(location, projectName, Encoding.UTF8);
        }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            //To init our app, we need to load all provider dlls from our plugins dir
            //The application needs the DLL umbraco.courier.providers.dll to work with the build-in providers
            //you can add any dll in there to load your own
            Umbraco.Courier.Core.Helpers.TypeResolver.LoadAssembliesIntoAppDomain(plugins, "*.dll");

            //we also need to tell it where to get it's config xml
            //this is the standard courier file which contains settings for the engines and providers
            Umbraco.Courier.Core.Context.Current.SettingsFilePath = Path.Combine(application, "courier.config");

            //finally we need to redirect the revisions root for correct mapping
            Umbraco.Courier.Core.Context.Current.BaseDirectory  = directory;
            Umbraco.Courier.Core.Context.Current.HasHttpContext = false;


            try
            {
                PackagingManager manager = PackagingManager.Instance;

                CourierWebserviceRepositoryProvider cp = new CourierWebserviceRepositoryProvider();
                cp.Login            = "******";
                cp.Password         = "******";
                cp.PasswordEncoding = "Hashed";
                cp.UserId           = -1;
                cp.Url = "http://cws.local";


                Repository r = new Repository(cp);
                r.Name  = "Console app repo";
                r.Alias = "console";

                manager.Load(Path.Combine(directory, "testingDirectory"));
                manager.EnableRemoteExtraction(r);

                manager.PackagedItem += new EventHandler <ItemEventArgs>(manager_PackagedItem);

                string err = "";



                manager.AddAllProvidersToQueue(true);

                Console.Write(manager.Queue.Count + " Items added");

                manager.PackageQueue();


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

            Console.Read();
        }