using System;
using System.Collections.Generic;
using System.IO;
namespace DeploymentHelpers
{
///
/// Parameters to control application deployment.
///
public class DeploymentParameters
{
///
/// Creates an instance of .
///
/// Source code location of the target location to be deployed.
/// Where to be deployed on.
/// Flavor of the clr to run against.
/// Architecture of the DNX to be used.
public DeploymentParameters(
string applicationPath,
ServerType serverType,
RuntimeFlavor runtimeFlavor,
RuntimeArchitecture runtimeArchitecture)
{
if (string.IsNullOrEmpty(applicationPath))
{
throw new ArgumentException("Value cannot be null.", "applicationPath");
}
if (!Directory.Exists(applicationPath))
{
throw new DirectoryNotFoundException(string.Format("Application path {0} does not exist.", applicationPath));
}
ApplicationPath = applicationPath;
ServerType = serverType;
RuntimeFlavor = runtimeFlavor;
RuntimeArchitecture = runtimeArchitecture;
}
public ServerType ServerType { get; private set; }
public RuntimeFlavor RuntimeFlavor { get; private set; }
public RuntimeArchitecture RuntimeArchitecture { get; private set; }
///
/// Suggested base url for the deployed application. The final deployed url could be
/// different than this. Use for the
/// deployed url.
///
public string ApplicationBaseUriHint { get; set; }
public string EnvironmentName { get; set; }
public string ApplicationHostConfigTemplateContent { get; set; }
public string ApplicationHostConfigLocation { get; set; }
public string SiteName { get; set; }
public string ApplicationPath { get; set; }
///
/// To publish the application before deployment.
///
public bool PublishApplicationBeforeDeployment { get; set; }
public string PublishedApplicationRootPath { get; set; }
///
/// Passes the --no-source option when publishing.
///
public bool PublishWithNoSource { get; set; }
public string DnxRuntime { get; set; }
///
/// Environment variables to be set before starting the host.
/// Not applicable for IIS Scenarios.
///
public List> EnvironmentVariables { get; private set; } = new List>();
///
/// For any application level cleanup to be invoked after performing host cleanup.
///
public Action UserAdditionalCleanup { get; set; }
}
}