Skip to content

Instantly share code, notes, and snippets.

View domgreen's full-sized avatar
👻
Boo!

Dominic Green domgreen

👻
Boo!
View GitHub Profile
@domgreen
domgreen / gist:942236
Created April 26, 2011 13:14
cloud deployment scenario using rake
def deploy_to_cloud
exec "cspack #{CSDEF} /role:WorkerRole1;#{WORKER_ROLE_DIR};#{WORKER_ROLE_DLL} /role:WebRole1;#{WEB_ROLE_DIR} /sites:WebRole1; Web;c:\web /out:#{CSPKG_FILE}"
exec "#{PACKAGE_UPLOADER_EXE} #{CSPKG_FILE} #{ACCOUNT_CONNECTION_STRING}"
exec "#{SUSPEND_COMMAND}"
exec "#{DELETE_COMMAND}"
exec "#{CREATE_COMMAND}"
exec "#{RUN_COMMAND}"
end
@domgreen
domgreen / gist:942233
Created April 26, 2011 13:13
rake version of automated deployment scripts for Windows Azure
# Top-level directories
SOURCE_DIR = ".."
PROJECT_NAME = "Demo"
# Local build and test
AZURE_SLN = "#{SOURCE_DIR}/#{PROJECT_NAME}.sln"
OUT_DIR = "bin/Debug/"
PUBLISH_LOCATION = "#{OUT_DIR}Publish/"
CSDEF = "ServiceDefinition.csdef"
CSCFG = "ServiceConfiguration.cscfg"
@domgreen
domgreen / gist:942172
Created April 26, 2011 12:31
MSBuild script to show the outline of an automated build to development fabric
<Target Name="LocalDeploy" DependsOnTargets="CorePackageComputeService" Condition=" '$(DeployType)' == 'Local' ">
<Exec Command="$(StopLocalDevFabric)"/>
<Exec Command="$(RunLocalDevFabric)" />
</Target>
@domgreen
domgreen / gist:942168
Created April 26, 2011 12:26
tokenised scenario for automating deployment to Windows Azure in MSBuild
<Target Name="CloudDeploy" DependsOnTargets="CorePublish" Condition=" '$(DeployType)' == 'Cloud' ">
<Exec Command="$(PackageUploader) $(cspkgFile) $(AccountConnectionString)"/>
<Exec Command="$(SuspendCommand)" ContinueOnError="true"/>
<Exec Command="$(DeleteCommand)" ContinueOnError="true"/>
<Exec Command="$(CreateCommand)" ContinueOnError="true"/>
<Exec Command="$(RunCommand)" ContinueOnError="true"/>
</Target>
@domgreen
domgreen / gist:942164
Created April 26, 2011 12:24
MSBuild script using tools to deploy Windows Azure package locally or to the public cloud
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<CloudExtensionsDir Condition=" '$(CloudExtensionsDir)' == '' ">
C:\Program Files (x86)\MSBuild\Microsoft\Cloud Service\1.0\Visual Studio 10.0\
</CloudExtensionsDir>
</PropertyGroup>
<Import Project="$(CloudExtensionsDir)Microsoft.CloudService.targets" />
<PropertyGroup>
<AccountConnectionString>...</AccountConnectionString>
@domgreen
domgreen / gist:923300
Created April 16, 2011 17:07
Build Targets that depend on packaging targets for cloud and local deployment
<Target Name="CloudDeploy" DependsOnTargets="CorePublish" Condition=" '$(DeployType)' == 'Cloud' ">
...
</Target>
<Target Name="LocalDeploy" DependsOnTargets="CorePackageComputeService" Condition=" '$(DeployType)' == 'Local' ">
...
</Target>
@domgreen
domgreen / gist:923297
Created April 16, 2011 17:05
property group to pull in build targets from the Azure SDK
<PropertyGroup>
<CloudExtensionsDir Condition=" '$(CloudExtensionsDir)' == '' ">
C:\Program Files (x86)\MSBuild\Microsoft\Cloud Service\
1.0\Visual Studio 10.0\
</CloudExtensionsDir>
</PropertyGroup>
<Import
Project="$(CloudExtensionsDir)Microsoft.CloudService.targets" />
@domgreen
domgreen / gist:923294
Created April 16, 2011 17:03
cspack to create Azure Web Role
cspack #{CSDEF}
/role:WorkerRole1;#{WORKER_ROLE_DIR};#{WORKER_ROLE_DLL}
/role:WebRole1;#{WEB_ROLE_DIR}
/sites:WebRole1; Web;c:\web
/out:#{CSPKG_FILE}
@domgreen
domgreen / gist:923288
Created April 16, 2011 17:01
cspack command to create a package for the public Azure Cloud
cspack ServiceDefinition.csdef
/out:Azure.cspkg
/role:MvcTestAzure;MvcTestAzure
/sites:MvcTestAzure;Web;MvcTestAzure
/generateConfigurationFile:ServiceConfiguration.cscfg
/rolePropertiesFile:MvcTestAzure;Props.txt
@domgreen
domgreen / gist:923287
Created April 16, 2011 16:59
CSRun command to launch dev fabric and launch browser
csrun /run:Azure.csx;ServiceConfiguration.cscfg
/devfabric /launchBrowser