Skip to content

Commit

Permalink
Azure packaging
Browse files Browse the repository at this point in the history
Executing ClickToBuild.cmd generates the package for Azure including all modules available in Orchard.Web automatically
AzureSDK in requiered for this tasks. If not present, the package won't succeed, but Orchard.Web will still be built
The Orchard.Azure solution contains the required environment for implementing Azure specific providers, and unit testing
The Orchard.Azure.CloudService solution contains the CloudService enrironment to simulate Azure platform locally

--HG--
branch : dev
  • Loading branch information
sebastienros committed May 7, 2010
1 parent ae801b6 commit 7248fb6
Show file tree
Hide file tree
Showing 21 changed files with 1,179 additions and 244 deletions.
1 change: 1 addition & 0 deletions .hgignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ glob:*.user
glob:*.patch
glob:*.hg
glob:build
glob:artifacts
glob:*.sln.cache
glob:src/Orchard.Web/Media/*
glob:desktop.ini
Expand Down
137 changes: 137 additions & 0 deletions AzurePackage.proj
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

<!-- Initialization -->

<PropertyGroup>
<LibFolder>$(MSBuildProjectDirectory)\lib</LibFolder>
<SrcFolder>$(MSBuildProjectDirectory)\src</SrcFolder>
<BuildFolder>$(MSBuildProjectDirectory)\build</BuildFolder>
<ArtifactsFolder>$(MSBuildProjectDirectory)\artifacts\Azure</ArtifactsFolder>

<CompileFolder>$(BuildFolder)\Compile</CompileFolder>
<ServiceFolder>$(CompileFolder)\Orchard.Azure.CloudService.csx</ServiceFolder>
<CloudRootFolder>$(ServiceFolder)\roles\Orchard.Azure.Web\approot</CloudRootFolder>
<WebSitesFolder>$(CompileFolder)\_PublishedWebsites</WebSitesFolder>
<StageFolder>$(BuildFolder)\Stage</StageFolder>

<BuildPlatform Condition="$(ProgramW6432) != ''">x64</BuildPlatform>
<BuildPlatform Condition="$(BuildPlatform) == ''">x86</BuildPlatform>

</PropertyGroup>

<Import Project="$(LibFolder)\msbuild\MSBuild.Community.Tasks.Targets"/>
<Import Project="$(MSBuildExtensionsPath)\Microsoft\Cloud Service\v1.0\Microsoft.CloudService.targets" />

<!-- Coordinating Targets -->

<Target Name ="Build">
<CallTarget Targets="Clean"/>
<CallTarget Targets="Compile"/>
<CallTarget Targets="Test"/>
<CallTarget Targets="Package"/>
</Target>

<Target Name="Package">
<CallTarget Targets="Package-Stage"/>
<CallTarget Targets="Package-Zip"/>
</Target>


<!-- Building -->

<Target Name="Clean">
<MSBuild Projects="$(SrcFolder)\Orchard.sln" Targets="Clean" />
<MSBuild Projects="$(SrcFolder)\Orchard.Azure\Orchard.Azure.CloudService.sln" Targets="Clean" />
<RemoveDir Directories="$(BuildFolder)" />
</Target>

<Target Name ="Compile">
<MSBuild
Projects="$(SrcFolder)\Orchard.Azure\Orchard.Azure.CloudService.sln"
Targets="Build"
Properties="Configuration=Release;OutputPath=$(CompileFolder)" />

<MSBuild
Projects="$(SrcFolder)\Orchard.Azure.sln"
Targets="Build"
Properties="Configuration=Release;OutputPath=$(CompileFolder)" />

<MSBuild
Projects="$(SrcFolder)\Orchard.sln"
Targets="Build"
Properties="Configuration=Release;OutputPath=$(CompileFolder)" />

</Target>


<!-- Testing - Azure only -->

<Target Name ="Test">
<Message Text="Testing with x64 version of Sqlite"/>

<CreateItem Include="$(CompileFolder)\*Azure.Tests.*dll">
<Output TaskParameter="Include" ItemName="TestAssemblies" />
</CreateItem>

<!-- use x64 sqlite for tests depending on build platform -->
<Copy
SourceFiles="$(LibFolder)\sqlite\x64\System.Data.SQLite.dll"
DestinationFiles="$(CompileFolder)\System.Data.SQLite.dll" />

<NUnit Assemblies="@(TestAssemblies)" ToolPath="$(LibFolder)\nunit" WorkingDirectory="$(CompileFolder)" />

</Target>

<Target Name ="Spec">
<CreateItem Include="$(CompileFolder)\*.Specs.dll">
<Output TaskParameter="Include" ItemName="SpecAssemblies" />
</CreateItem>
<NUnit Assemblies="@(SpecAssemblies)" ToolPath="$(LibFolder)\nunit" />
</Target>

<!-- Packaging -->

<Target Name="Package-Stage">

<ItemGroup>
<Stage-Bin-Exclude Include="$(WebSitesFolder)\**\bin\**\*" />
<Stage-Orchard-Web-Exclude Include="$(WebSitesFolder)\**\Orchard.Web\**\*" />

<Stage-Themes Include="$(WebSitesFolder)\Orchard.Web\Themes\**\*" />
<Stage-Core Include="$(WebSitesFolder)\Orchard.Core\**\*" Exclude="@(Stage-Bin-Exclude)" />
<Stage-Modules Include="$(WebSitesFolder)\**\*" Exclude="@(Stage-Core);@(Stage-Bin-Exclude);@(Stage-Orchard-Web-Exclude)" />
<Stage-Modules-Bin Include="$(WebSitesFolder)\Orchard.Web\**\bin\*"/>
</ItemGroup>

<Copy SourceFiles="@(Stage-Themes)" DestinationFolder="$(CloudRootFolder)\Themes\%(RecursiveDir)" />
<Copy SourceFiles="@(Stage-Core)" DestinationFolder="$(CloudRootFolder)\Core\%(RecursiveDir)" />
<Copy SourceFiles="@(Stage-Modules)" DestinationFolder="$(CloudRootFolder)\Modules\%(RecursiveDir)" />
<Copy SourceFiles="@(Stage-Modules-Bin)" DestinationFolder="$(CloudRootFolder)\bin\" />

<!-- use x64 sqlite for tests depending on build platform -->
<Copy
SourceFiles="$(LibFolder)\sqlite\x64\System.Data.SQLite.dll"
DestinationFiles="$(CloudRootFolder)\bin\System.Data.SQLite.dll" />

<Copy
SourceFiles="$(SrcFolder)\Orchard.Azure\Orchard.Azure.CloudService\ServiceConfiguration.cscfg"
DestinationFolder="$(StageFolder)"
/>

<Exec
Command="&quot;$(ServiceHostingSDKBinDir)cspack&quot; &quot;$(ServiceFolder)\ServiceDefinition.csdef&quot; /role:Orchard.Azure.Web;&quot;$(CloudRootFolder)&quot;;Orchard.Azure.Web.dll /out:&quot;$(StageFolder)\Orchard.cspkg&quot;"
WorkingDirectory="$(CloudRootFolder)"
/>

</Target>

<Target Name="Package-Zip">
<ItemGroup>
<Zip-Stage Include="$(StageFolder)\ServiceConfiguration.cscfg;$(StageFolder)\Orchard.cspkg" />
</ItemGroup>

<MakeDir Directories="$(ArtifactsFolder)" />
<Zip Files="@(Zip-Stage)" WorkingDirectory="$(StageFolder)" ZipFileName="$(ArtifactsFolder)\AzurePackage.zip" />
</Target>
</Project>
3 changes: 2 additions & 1 deletion build.cmd
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
if "%~1"=="" build Build
msbuild /t:%~1
msbuild /t:%~1 Orchard.proj
msbuild /t:%~1 AzurePackage.proj
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ public void Setup() {
DeleteAllBlobs( ((AzureShellSettingsManager)Loader).Container);
}

[TearDown]
public void TearDown() {
// ensure default container is empty after running tests
DeleteAllBlobs(( (AzureShellSettingsManager)Loader ).Container);
}

[Test]
public void SingleSettingsFileShouldComeBackAsExpected() {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
using System;
using System.Configuration;
using System.IO;
using NUnit.Framework;
using System.Diagnostics;
using Orchard.Azure.Storage;
using Microsoft.WindowsAzure;
using System.Linq;
using Microsoft.WindowsAzure.StorageClient;
using System.Text;

namespace Orchard.Azure.Tests.Storage {
[TestFixture]
Expand Down
Loading

0 comments on commit 7248fb6

Please sign in to comment.