forked from projectkudu/kudu
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Separate Kudu's site management logic into separate assembly (Kudu.Si…
…teManagement). - Inject SiteManager in the Kudu.Web - Discover siteroot and application room from web.config settings.
- Loading branch information
Showing
15 changed files
with
206 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
using System.IO; | ||
|
||
namespace Kudu.SiteManagement | ||
{ | ||
public class DefaultPathResolver : IPathResolver | ||
{ | ||
private readonly string _rootPath; | ||
private readonly string _serviceSitePath; | ||
|
||
public DefaultPathResolver(string serviceSitePath, string rootPath) | ||
{ | ||
_serviceSitePath = Path.GetFullPath(serviceSitePath); | ||
_rootPath = Path.GetFullPath(rootPath); | ||
} | ||
|
||
public string ServiceSitePath | ||
{ | ||
get | ||
{ | ||
return _serviceSitePath; | ||
} | ||
} | ||
|
||
public string GetApplicationPath(string applicationName) | ||
{ | ||
return Path.Combine(_rootPath, applicationName, "live"); | ||
} | ||
|
||
public string GetDeveloperApplicationPath(string applicationName) | ||
{ | ||
return Path.Combine(_rootPath, applicationName, "dev"); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
namespace Kudu.SiteManagement | ||
{ | ||
public interface IPathResolver | ||
{ | ||
string ServiceSitePath { get; } | ||
string GetApplicationPath(string applicationName); | ||
string GetDeveloperApplicationPath(string applicationName); | ||
} | ||
} |
6 changes: 2 additions & 4 deletions
6
Kudu.Web/Infrastructure/ISiteManager.cs → Kudu.SiteManagement/ISiteManager.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,10 @@ | ||
using Kudu.Web.Models; | ||
|
||
namespace Kudu.Web.Infrastructure | ||
namespace Kudu.SiteManagement | ||
{ | ||
public interface ISiteManager | ||
{ | ||
Site CreateSite(string applicationName); | ||
void DeleteSite(string applicationName); | ||
bool TryCreateDeveloperSite(string applicationName, out string siteUrl); | ||
void SetDeveloperSiteWebRoot(string applicationName, string projectPath); | ||
void SetDeveloperSiteWebRoot(string applicationName, string siteRoot); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<PropertyGroup> | ||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | ||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> | ||
<ProductVersion>8.0.30703</ProductVersion> | ||
<SchemaVersion>2.0</SchemaVersion> | ||
<ProjectGuid>{D5669C1D-3408-4CEE-8C1B-D86D03D27EE2}</ProjectGuid> | ||
<OutputType>Library</OutputType> | ||
<AppDesignerFolder>Properties</AppDesignerFolder> | ||
<RootNamespace>Kudu.SiteManagement</RootNamespace> | ||
<AssemblyName>Kudu.SiteManagement</AssemblyName> | ||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion> | ||
<FileAlignment>512</FileAlignment> | ||
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\kudu\</SolutionDir> | ||
<RestorePackages>true</RestorePackages> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> | ||
<DebugSymbols>true</DebugSymbols> | ||
<DebugType>full</DebugType> | ||
<Optimize>false</Optimize> | ||
<OutputPath>bin\Debug\</OutputPath> | ||
<DefineConstants>DEBUG;TRACE</DefineConstants> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> | ||
<DebugType>pdbonly</DebugType> | ||
<Optimize>true</Optimize> | ||
<OutputPath>bin\Release\</OutputPath> | ||
<DefineConstants>TRACE</DefineConstants> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Reference Include="Microsoft.Web.Administration, Version=7.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> | ||
<HintPath>..\..\..\..\Windows\System32\inetsrv\Microsoft.Web.Administration.dll</HintPath> | ||
</Reference> | ||
<Reference Include="System" /> | ||
<Reference Include="System.Core" /> | ||
<Reference Include="System.IO.Abstractions"> | ||
<HintPath>..\packages\System.IO.Abstractions.1.4.0.12\lib\net35\System.IO.Abstractions.dll</HintPath> | ||
</Reference> | ||
<Reference Include="System.Xml.Linq" /> | ||
<Reference Include="System.Data.DataSetExtensions" /> | ||
<Reference Include="Microsoft.CSharp" /> | ||
<Reference Include="System.Data" /> | ||
<Reference Include="System.Xml" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Compile Include="..\Common\CommonAssemblyInfo.cs"> | ||
<Link>Properties\CommonAssemblyInfo.cs</Link> | ||
</Compile> | ||
<Compile Include="..\Common\Constants.cs"> | ||
<Link>Constants.cs</Link> | ||
</Compile> | ||
<Compile Include="..\Kudu.Core\Infrastructure\FileSystemHelpers.cs"> | ||
<Link>FileSystemHelpers.cs</Link> | ||
</Compile> | ||
<Compile Include="DefaultPathResolver.cs" /> | ||
<Compile Include="IPathResolver.cs" /> | ||
<Compile Include="ISiteManager.cs" /> | ||
<Compile Include="Properties\AssemblyInfo.cs" /> | ||
<Compile Include="Site.cs" /> | ||
<Compile Include="SiteManager.cs" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<None Include="packages.config" /> | ||
</ItemGroup> | ||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> | ||
<Import Project="$(SolutionDir)\.nuget\nuget.targets" /> | ||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. | ||
Other similar extension points exist, see Microsoft.Common.targets. | ||
<Target Name="BeforeBuild"> | ||
</Target> | ||
<Target Name="AfterBuild"> | ||
</Target> | ||
--> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
using System.Reflection; | ||
|
||
[assembly: AssemblyTitle("Kudu.SiteManagement")] | ||
[assembly: AssemblyDescription("Site management logic for kudu")] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<packages> | ||
<package id="System.IO.Abstractions" version="1.4.0.12" /> | ||
</packages> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.