Пример #1
0
 public static bool DeployPackageUnElevated(Package package, DeploymentAction action)
 {
     if (PackageDebugSettingsService.PackageOperationNeedsElevation(package))
     {
         try
         {
             // Format: <path-to-this.exe> VERB "<path-to-package>"
             Process.Start(new ProcessStartInfo
             {
                 FileName  = Process.GetCurrentProcess().MainModule.FileName,
                 Arguments = action.ToString().ToUpper() + " \"" + package.PackagePath + "\"",
                 Verb      = "runas"
             });
             return(true);
         }
         catch (Exception e)
         {
             Debug.WriteLine("Failed to start elevated worker instance:\n" + e.StackTrace);
             return(false);
         }
     }
     else
     {
         DeployPackageElevated(package, action);
         return(true);
     }
 }
        public MainWindow()
        {
            InitializeComponent();
            DataContext = new MainViewModel();

            editorWindow = new EditorWindow();

            tmAlignEditorWindow = new DispatcherTimer
            {
                Interval  = new TimeSpan(0, 0, 0, 0, 500),
                IsEnabled = false,
            };

            tmAlignEditorWindow.Tick += tmAlignEditorWindow_Tick;

            txtLog.Text =

                @"
Bitte geben Sie Ihre, Zugangsdaten ein und melden sich an.
Wählen darauf einen Kontaktordner aus und betätigen Sie 'Importieren'.

Sie erhalten nun eine Vorschau auf die gefunden Kontakte, 
die Sie in dieser Anwendung vor dem Export editieren können.

Zum Schluss wählen Sie den Pfad zur Ausgabedatei aus und betätigen 
Sie die Schaltfläche 'Exportieren', um die Ausgabedatei zu befüllen.

";

            txtLog.Text += $"(Programmversion: {DeploymentAction.GetRunningVersion()})";

            Console.SetOut(new TextBoxOutputter(txtLog));
        }
 public static bool DeployPackageUnElevated(Package package, DeploymentAction action)
 {
     if (PackageDebugSettingsService.PackageOperationNeedsElevation(package))
     {
         try
         {
             // Format: <path-to-this.exe> VERB "<path-to-package>"
             Process.Start(new ProcessStartInfo
             {
                 FileName = Process.GetCurrentProcess().MainModule.FileName,
                 Arguments = action.ToString().ToUpper() + " \"" + package.PackagePath + "\"",
                 Verb = "runas"
             });
             return true;
         }
         catch (Exception e)
         {
             Debug.WriteLine("Failed to start elevated worker instance:\n" + e.StackTrace);
             return false;
         }
     }
     else
     {
         DeployPackageElevated(package, action);
         return true;
     }
 }
 public static YamlDeploymentAction FromModel(DeploymentAction model)
 {
     return(new YamlDeploymentAction
     {
         Name = model.Name,
         ActionType = model.ActionType,
         Properties = YamlPropertyValue.FromModel(model.Properties),
         EnvironmentRefs = model.EnvironmentRefs.Select(r => r.Name).ToArray().NullIfEmpty()
     });
 }
Пример #5
0
        public void ProcessTag(JToken innerJson, JToken entireJson, Dictionary <string, UIPage> allPages, Dictionary <string, IAction> allActions, App app)
        {
            foreach (var child in innerJson.Children())
            {
                string actionName = child["name"].ToString(Formatting.None).Replace("\"", "");

                var action = allActions[actionName];


                string           displayName      = child["displayname"] != null ? child["displayname"].ToString(Formatting.None).Replace("\"", "") : actionName;
                DeploymentAction deploymentAction = new DeploymentAction(displayName, action, child);
                app.Actions.Add(deploymentAction);
            }
        }
Пример #6
0
        static void UpdateChannels(DeploymentActionResource resource, DeploymentAction model, ProjectResource projectResource, IOctopusRepository repository)
        {
            List <ChannelResource> channelResources = new List <ChannelResource>();

            foreach (var channelRef in model.ChannelRefs)
            {
                var channel = repository.Channels.FindByName(projectResource, channelRef.Name);
                channelResources.Add(channel);
            }

            if (channelResources.Any())
            {
                resource.ForChannels(channelResources.ToArray());
            }
        }
 void ExecuteTest(
     DeploymentAction action,
     [CallerMemberName]
     string?testName = null
     )
 => ExecuteTest(
     new VcsRunbook("My Runbook"),
     new RunbookProcess(ProjectId, SpaceId)
 {
     Steps =
     {
         new DeploymentStep(action.Name)
         {
             Actions ={ action               }
         }
     }
 },
     testName);
Пример #8
0
        public static void DeployPackageElevated(Package package, DeploymentAction action)
        {
            switch (action)
            {
            case DeploymentAction.Install_Package:
                PackageDebugSettingsService.SetDebuggerForPackage(package);
                PackageStoreService.Add(package);
                break;

            case DeploymentAction.Remove_Package:
                PackageDebugSettingsService.ClearDebuggerForPackage(package);
                PackageStoreService.Delete(package);
                break;

            default:
                throw new NotImplementedException();
            }
        }
        public static void DeployPackageElevated(Package package, DeploymentAction action)
        {
            switch (action)
            {
                case DeploymentAction.Install_Package:
                    PackageDebugSettingsService.SetDebuggerForPackage(package);
                    PackageStoreService.Add(package);
                    break;

                case DeploymentAction.Remove_Package:
                    PackageDebugSettingsService.ClearDebuggerForPackage(package);
                    PackageStoreService.Delete(package);
                    break;

                default:
                    throw new NotImplementedException();
            }
        }
        public object ProcessTag(JToken innerJson, JToken entireJson, Dictionary <string, UIPage> allPages, Dictionary <string, IAction> allActions, App app, List <TagReturn> childObjects)
        {
            List <TagReturn> actionsToReturn = new List <TagReturn>();

            foreach (var child in innerJson.Children())
            {
                string actionName = child["name"].ToString(Formatting.None).Replace("\"", "");

                var action = allActions[actionName];

                if (!action.Equals(default(KeyValuePair <string, IAction>)))
                {
                    string           displayName      = child["displayname"] != null ? child["displayname"].ToString(Formatting.None).Replace("\"", "") : actionName;
                    DeploymentAction deploymentAction = new DeploymentAction(displayName, action, child);
                    actionsToReturn.Add(new TagReturn("Actions", deploymentAction));
                }
            }

            return(actionsToReturn);
        }
Пример #11
0
 /// <summary>
 /// Performs a case-insensitive comparison
 /// </summary>
 public bool DeploymentActionNameMatches(string name)
 {
     return(DeploymentAction.Equals(name, StringComparison.OrdinalIgnoreCase));
 }
 public void DeployContent(RuntimeContentModel model, DeploymentAction action)
 {
     
 }
Пример #13
0
 public static DeploymentActionResource UpdateWith(this DeploymentActionResource resource, DeploymentAction model, IOctopusRepository repository)
 {
     resource.Name       = model.Name;
     resource.ActionType = model.ActionType;
     resource.Properties.UpdateWith(model.Properties);
     resource.Environments.UpdateWith(model.EnvironmentRefs.Select(r => repository.Environments.ResolveResourceId(r)));
     return(resource);
 }