예제 #1
0
        /// <summary>
        /// Get list of installed application templates.
        /// </summary>
        /// <returns></returns>
        public List <InstalledApplication> GetInstalledApplicationTemplates(string identifiers = null)
        {
            List <InstalledApplication> apps = new List <InstalledApplication>();

            var installedAppsFolder = this.GlobalSettings.applicationTemplateDir;
            var difo = new DirectoryInfo(installedAppsFolder);

            if (!difo.Exists)
            {
                throw new Exception($"Non existent installed applications folder: {installedAppsFolder}");
            }

            foreach (var file in difo.EnumerateFiles())
            {
                var installedApp = new InstalledApplication();
                installedApp.ParseFromString(File.ReadAllText(file.FullName));

                if (string.IsNullOrWhiteSpace(identifiers) ||
                    this.ExplodeAndCleanList(identifiers, ",").Contains(installedApp.GetId()))
                {
                    apps.Add(installedApp);
                }
            }

            return(apps);
        }
예제 #2
0
        /// <summary>
        /// Deploy a single app from it's YAML settings. For testing purposes only.
        /// </summary>
        /// <param name="settings"></param>
        public Deployment DeploySingleAppFromTextSettings(string settings, bool force = false, string buildId = null)
        {
            InstalledApplication installedApplication = new InstalledApplication();

            installedApplication.ParseFromString(settings);
            return(this.DeploySingleAppFromInstalledApplication(installedApplication, force, buildId, true));
        }
예제 #3
0
        /// <summary>
        /// Undeploy a single app from it's YAML settings. For testing purposes only.
        /// </summary>
        /// <param name="settings"></param>
        public void UndeploySingleApp(string settings)
        {
            InstalledApplication app = new InstalledApplication();

            app.ParseFromString(settings);

            ApplicationDeployer deployer = new ApplicationDeployer(this.GlobalSettings, app, this.Logger);

            deployer.UninstallApp();
        }