示例#1
0
 private void FillWithDefaults(string user, ProjectMetadata metadata,
                               CustomizableSettings customizableSettings)
 {
     customizableSettings.Host               = "hostname";
     customizableSettings.DestinationPath    = $"/home/{user ?? "[USER]"}/DotNetApps/{metadata.ProjectName}";
     customizableSettings.Display            = ":0.0";
     customizableSettings.RunAfterDeployment = true;
     customizableSettings.AssemblyName       = metadata.AssemblyName;
     customizableSettings.Framework          = metadata.Frameworks.First();
 }
示例#2
0
        private DeploymentProfile CreateNew(string profileName, string username, ProjectMetadata metadata)
        {
            Console.WriteLine(Resources.CreatingProfile, profileName);
            Console.WriteLine(Resources.InformationPrompt);
            var settings = new CustomizableSettings();
            var profile  = new DeploymentProfile(profileName, settings);

            if (string.IsNullOrWhiteSpace(username))
            {
                username = PromptRemoteUsername();
            }

            FillWithDefaults(username, metadata, settings);
            Fill(settings);
            return(profile);
        }
示例#3
0
 private static string GetExecutableName(CustomizableSettings settings)
 {
     return(settings.DestinationPath + "/" + settings.AssemblyName);
 }
示例#4
0
        private static void GiveExecutablePermission(CustomizableSettings settings, ISecureSession userAndPasswordSecureSession)
        {
            var executable = GetExecutableName(settings);

            userAndPasswordSecureSession.Ssh.RunCommand($"chmod +x {executable}");
        }