Пример #1
0
 private void InternalRunPackage(Object parameter)
 {
     try
     {
         BaseAction    selectedAction = (BaseAction)parameter;
         PackageRunner pr             = new PackageRunner();
         var           variables      = EnvironmentManager.LoadVariables(System.IO.Path.GetDirectoryName(Package.PackageLocation), Package.DefaultRunVariableSet);
         pr.RunIndividualPackage(Package.PackageLocation, variables, selectedAction, null, false);
     }
     catch (Exception ex)
     {
         threadException = ex;
     }
     finally
     {
         inProgress = false;
     }
 }
Пример #2
0
        private void tbMarkAsDeployed_Click(object sender, EventArgs e)
        {
            if (!SaveIfRequired())
            {
                return;
            }

            vss.Initilize(System.IO.Path.GetDirectoryName(Package.PackageLocation), Package.DefaultRunVariableSet);
            //if (MessageBox.Show("You are about to run this package. Do you want to proceed?", Text, MessageBoxButtons.OKCancel) == DialogResult.OK)
            if (vss.ShowDialog() == DialogResult.OK)
            {
                Package.DefaultRunVariableSet = vss.SelectedSet;
                storageProvider.SavePackage(Package);//To save variable selection
                PackageRunner pr = new PackageRunner();
                pr.MarkPackageAsDeployed(Package);
                ShowMessage("Success");
            }
        }
Пример #3
0
 private void InternalBuild()
 {
     try
     {
         PackageRunner     pr        = new PackageRunner();
         var               variables = EnvironmentManager.LoadVariables(System.IO.Path.GetDirectoryName(Package.PackageLocation), Package.DefaultBuildVariableSet);
         BaseChangePackage bcp       = storageProvider.LoadPackage(Package.PackageLocation);
         bcp.UpdateRuntimeData(variables);
         bcp.Build(storageProvider);
     }
     catch (Exception ex)
     {
         threadException = ex;
     }
     finally
     {
         inProgress = false;
     }
 }
Пример #4
0
        static void Main(string[] args)
        {
            if (args.Length == 0)
            {
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
            }

            BaseComponent.Log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);

            var         storageList     = StorageFactory.GetStorageList();
            var         storageProvider = storageList[0];
            List <Type> types           = new List <Type>();

            foreach (var obj in PackageFactory.GetPackageList())
            {
                types.Add(obj.GetType());
            }
            foreach (var obj in SolutionFactory.GetSolutionList())
            {
                types.Add(obj.GetType());
            }
            foreach (var obj in ActionFactory.GetActionList())
            {
                types.Add(obj.GetType());
            }

            storageProvider.AddKnownTypes(types);
            MainForm.storageProvider = storageProvider;

            if (args.Length == 0)
            {
                Application.Run(new MainForm());
            }
            else
            {
                AllocConsole();
                BaseComponent.LogInfo("Starting..");
                PackageRunner pr = new PackageRunner();
                if (args.Length > 2)
                {
                    if (args[0] == "/b")
                    {
                        if (args.Length == 4)
                        {
                            pr.BuildIndividualPackage(args[1], args[3], args[2]);
                        }
                        else
                        {
                            BaseComponent.LogInfo("Expected format: /b <folder> <targetenv> <packagename>");
                        }
                    }
                    else if (args[0] == "/r")
                    {
                        if (args.Length == 4)
                        {
                            pr.RunIndividualPackage(args[1], args[2], args[3], true);
                        }
                        else
                        {
                            BaseComponent.LogInfo("Expected format: /r <folder> <targetenv> <packagename>");
                        }
                    }
                    else
                    {
                        pr.RunIndividualPackage(args[0], args[1], args[2], true);
                    }
                }
                else
                {
                    pr.RunPackages(args[0], args[1]);
                }
                BaseComponent.LogInfo("Done");
                //Console.ReadLine();
            }
        }