Skip to content

Instantly share code, notes, and snippets.

@rukeba
Last active December 23, 2015 17:38
Show Gist options
  • Save rukeba/6669770 to your computer and use it in GitHub Desktop.
Save rukeba/6669770 to your computer and use it in GitHub Desktop.
Running Helicon Zoo powered web site on Windows Azure Cloud Service
@echo off
set WINDOWS_AZURE_SDK_PATH="C:\Program Files\Microsoft SDKs\Windows Azure\.NET SDK\v2.1"
call %WINDOWS_AZURE_SDK_PATH%\bin\setenv.cmd
pushd %~dp0
if "%ServiceHostingSDKInstallPath%" == "" (
echo Can't see the ServiceHostingSDKInstallPath environment variable. Please run from a Windows Azure SDK command-line (run Program Files\Windows Azure SDK\^<version^>\bin\setenv.cmd^).
GOTO :eof
)
rem remove unused files
del /s /q *.log *.pyc *.pyo >nul 2>nul
cspack ServiceDefinition.csdef /out:zoo-azure.cspkg
popd
<?xml version="1.0" encoding="utf-8"?>
<ServiceConfiguration serviceName="WindowsAzure2" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceConfiguration" osFamily="2" osVersion="*" schemaVersion="2013-03.2.0">
<Role name="WebRole1">
<Instances count="1" />
<ConfigurationSettings>
</ConfigurationSettings>
</Role>
</ServiceConfiguration>
<?xml version="1.0" encoding="utf-8"?>
<ServiceDefinition name="WindowsAzure2" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceDefinition" schemaVersion="2013-03.2.0">
<WebRole name="WebRole1" vmsize="Small">
<Sites>
<Site name="Web" physicalDirectory="./WebRole1">
<Bindings>
<Binding name="Endpoint1" endpointName="Endpoint1" />
</Bindings>
</Site>
</Sites>
<Endpoints>
<InputEndpoint name="Endpoint1" protocol="http" port="80" />
</Endpoints>
<Startup>
<Task commandLine="startup.cmd" executionContext="elevated" taskType="simple" >
</Task>
</Startup>
</WebRole>
</ServiceDefinition>
icacls %RoleRoot%\approot /grant "Everyone":F /T
echo Starting installation...
rem set AppData env to local folder
md "%~dp0appdata"
reg add "hku\.default\software\microsoft\windows\currentversion\explorer\user shell folders" /v "Local AppData" /t REG_EXPAND_SZ /d "%~dp0appdata" /f
pushd "%~dp0"..\offline-package\bin
WebpiCmd.exe /install /Products:PythonHostingPackage /XML:%RoleRoot%\approot\offline-package\feeds\latest\webproductlist.xml /Feeds:%RoleRoot%\approot\offline-package\feeds\latest\supplementalfeeds\feed.xml /AcceptEula >%~dp0\..\..\install.txt 2>%~dp0\..\..\install-error.txt
popd
rem revert back AppData env
reg add "hku\.default\software\microsoft\windows\currentversion\explorer\user shell folders" /v "Local AppData" /t REG_EXPAND_SZ /d %%USERPROFILE%%\AppData\Local /f
rem remove offline package
rmdir "%~dp0"..\offline-package /s /q
echo Completed installation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment