我运行 Azure 命令行工具来生成下面的脚本,使用以下命令
C:\GameDev\DevPortal>azure site deploymentscript --aspWAP "DeveloperPortal\Devel
operPortal.csproj" -s "DeveloperPortal.sln"
剧本:
@echo off
:: ----------------------
:: KUDU Deployment Script
:: ----------------------
:: Prerequisites
:: -------------
:: Verify node.js installed
where node 2>nul >nul
IF %ERRORLEVEL% NEQ 0 (
echo Missing node.js executable, please install node.js, if already installed make sure it can be reached from current environment.
goto error
)
:: Setup
:: -----
setlocal enabledelayedexpansion
SET ARTIFACTS=%~dp0%artifacts
IF NOT DEFINED DEPLOYMENT_SOURCE (
SET DEPLOYMENT_SOURCE=%~dp0%.
)
IF NOT DEFINED DEPLOYMENT_TARGET (
SET DEPLOYMENT_TARGET=%ARTIFACTS%\wwwroot
)
IF NOT DEFINED NEXT_MANIFEST_PATH (
SET NEXT_MANIFEST_PATH=%ARTIFACTS%\manifest
IF NOT DEFINED PREVIOUS_MANIFEST_PATH (
SET PREVIOUS_MANIFEST_PATH=%ARTIFACTS%\manifest
)
)
IF NOT DEFINED KUDU_SYNC_CMD (
:: Install kudu sync
echo Installing Kudu Sync
call npm install kudusync -g --silent
IF !ERRORLEVEL! NEQ 0 goto error
:: Locally just running "kuduSync" would also work
SET KUDU_SYNC_CMD=node "%appdata%\npm\node_modules\kuduSync\bin\kuduSync"
)
IF NOT DEFINED DEPLOYMENT_TEMP (
SET DEPLOYMENT_TEMP=%temp%\___deployTemp%random%
SET CLEAN_LOCAL_DEPLOYMENT_TEMP=true
)
IF DEFINED CLEAN_LOCAL_DEPLOYMENT_TEMP (
IF EXIST "%DEPLOYMENT_TEMP%" rd /s /q "%DEPLOYMENT_TEMP%"
mkdir "%DEPLOYMENT_TEMP%"
)
IF NOT DEFINED MSBUILD_PATH (
SET MSBUILD_PATH=%WINDIR%\Microsoft.NET\Framework\v4.0.30319\msbuild.exe
)
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: Deployment
:: ----------
echo Handling .NET Web Application deployment.
:: 1. Build to the temporary path
%MSBUILD_PATH% "%DEPLOYMENT_SOURCE%\DeveloperPortal\DeveloperPortal.csproj" /nologo /verbosity:m /t:Build /t:pipelinePreDeployCopyAllFilesToOneFolder /p:_PackageTempDir="%DEPLOYMENT_TEMP%";AutoParameterizationWebConfigConnectionStrings=false;Configuration=Release /p:SolutionDir="%DEPLOYMENT_SOURCE%\.\\" %SCM_BUILD_ARGS%
IF !ERRORLEVEL! NEQ 0 goto error
:: 2. Durandal Node js Optimize
echo Running Durandal Optimizer
%DEPLOYMENT_SOURCE%\DeveloperPortal\App\durandal\amd\optimizer --source %DEPLOYMENT_TEMP%\App\
:: 3. KuduSync
call %KUDU_SYNC_CMD% -v 50 -f "%DEPLOYMENT_TEMP%" -t "%DEPLOYMENT_TARGET%" -n "%NEXT_MANIFEST_PATH%" -p "%PREVIOUS_MANIFEST_PATH%" -i ".git;.hg;.deployment;deploy.cmd"
IF !ERRORLEVEL! NEQ 0 goto error
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
goto end
:error
echo An error has occurred during web site deployment.
call :exitSetErrorLevel
call :exitFromFunction 2>nul
:exitSetErrorLevel
exit /b 1
:exitFromFunction
()
:end
echo Finished successfully.
我在部署区域中添加了第 2 步,它调用了优化器,我提供了源代码,因为我注意到如果我不这样做,我会在优化完成后找到一个 js 文件时出错。
一切运行良好,但是 Azure 上的网站没有更新,没有任何更改通过,我查看日志,它有以下内容:
Command: deploy.cmd
Handling .NET Web Application deployment.
All packages listed in packages.config are already installed.
DeveloperPortal -> C:\DWASFiles\Sites\socialplay\VirtualDirectory0\site\repository\DeveloperPortal\bin\DeveloperPortal.dll
Transformed Web.config using C:\DWASFiles\Sites\socialplay\VirtualDirectory0\site\repository\DeveloperPortal\Web.Release.config into obj\Release\TransformWebConfig\transformed\Web.config.
Copying all files to temporary location below for package/publish:
C:\DWASFiles\Sites\socialplay\Temp\8bdcc230-a749-42d9-9b04-dfb7f84a5bf1.
Running Durandal Optimizer
Using default base configuration.
Configuring for deploy with almond (custom).
{
"name": "durandal/amd/almond-custom",
"inlineText": true,
"stubModules": [
"durandal/amd/text"
],
"paths": {
"text": "durandal/amd/text"
},
"baseUrl": "C:\\DWASFiles\\Sites\\socialplay\\VirtualDirectory0\\site\\repository\\DeveloperPortal\\App\\",
"mainConfigFile": "C:\\DWASFiles\\Sites\\socialplay\\VirtualDirectory0\\site\\repository\\DeveloperPortal\\App\\main.js",
"include": [
"C:/DWASFiles/Sites/socialplay/VirtualDirectory0/site/repository/DeveloperPortal/App/main-built",
"C:/DWASFiles/Sites/socialplay/VirtualDirectory0/site/repository/DeveloperPortal/App/main",
"C:/DWASFiles/Sites/socialplay/VirtualDirectory0/site/repository/DeveloperPortal/App/content/text/GamesLocalization",
"C:/DWASFiles/Sites/socialplay/VirtualDirectory0/site/repository/DeveloperPortal/App/content/text/InstantiatedItemsLocalization",
"C:/DWASFiles/Sites/socialplay/VirtualDirectory0/site/repository/DeveloperPortal/App/content/text/itemWizardLocalization",
"C:/DWASFiles/Sites/socialplay/VirtualDirectory0/site/repository/DeveloperPortal/App/content/text/r",
"C:/DWASFiles/Sites/socialplay/VirtualDirectory0/site/repository/DeveloperPortal/App/durandal/app",
"C:/DWASFiles/Sites/socialplay/VirtualDirectory0/site/repository/DeveloperPortal/App/durandal/composition",
"C:/DWASFiles/Sites/socialplay/VirtualDirectory0/site/repository/DeveloperPortal/App/durandal/events",
"C:/DWASFiles/Sites/socialplay/VirtualDirectory0/site/repository/DeveloperPortal/App/durandal/http",
"text!C:/DWASFiles/Sites/socialplay/VirtualDirectory0/site/repository/DeveloperPortal/App/durandal/messageBox.html",
"C:/DWASFiles/Sites/socialplay/VirtualDirectory0/site/repository/DeveloperPortal/App/durandal/messageBox",
"C:/DWASFiles/Sites/socialplay/VirtualDirectory0/site/repository/DeveloperPortal/App/durandal/modalDialog",
"C:/DWASFiles/Sites/socialplay/VirtualDirectory0/site/repository/DeveloperPortal/App/durandal/system",
"C:/DWASFiles/Sites/socialplay/VirtualDirectory0/site/repository/DeveloperPortal/App/durandal/viewEngine",
"C:/DWASFiles/Sites/socialplay/VirtualDirectory0/site/repository/DeveloperPortal/App/durandal/viewLocator",
"C:/DWASFiles/Sites/socialplay/VirtualDirectory0/site/repository/DeveloperPortal/App/durandal/viewModel",
"C:/DWASFiles/Sites/socialplay/VirtualDirectory0/site/repository/DeveloperPortal/App/durandal/viewModelBinder",
"C:/DWASFiles/Sites/socialplay/VirtualDirectory0/site/repository/DeveloperPortal/App/durandal/widget",
"C:/DWASFiles/Sites/socialplay/VirtualDirectory0/site/repository/DeveloperPortal/App/durandal/plugins/router",
"C:/DWASFiles/Sites/socialplay/VirtualDirectory0/site/repository/DeveloperPortal/App/durandal/transitions/entrance",
"C:/DWASFiles/Sites/socialplay/VirtualDirectory0/site/repository/DeveloperPortal/App/services/dataservice",
"C:/DWASFiles/Sites/socialplay/VirtualDirectory0/site/repository/DeveloperPortal/App/services/logger",
"C:/DWASFiles/Sites/socialplay/VirtualDirectory0/site/repository/DeveloperPortal/App/viewmodels/appdetails",
"C:/DWASFiles/Sites/socialplay/VirtualDirectory0/site/repository/DeveloperPortal/App/viewmodels/baseitems",
"C:/DWASFiles/Sites/socialplay/VirtualDirectory0/site/repository/DeveloperPortal/App/viewmodels/classes",
"C:/DWASFiles/Sites/socialplay/VirtualDirectory0/site/repository/DeveloperPortal/App/viewmodels/documentation",
"C:/DWASFiles/Sites/socialplay/VirtualDirectory0/site/repository/DeveloperPortal/App/viewmodels/games",
"C:/DWASFiles/Sites/socialplay/VirtualDirectory0/site/repository/DeveloperPortal/App/viewmodels/home",
"C:/DWASFiles/Sites/socialplay/VirtualDirectory0/site/repository/DeveloperPortal/App/viewmodels/items",
"C:/DWASFiles/Sites/socialplay/VirtualDirectory0/site/repository/DeveloperPortal/App/viewmodels/itemstore",
"C:/DWASFiles/Sites/socialplay/VirtualDirectory0/site/repository/DeveloperPortal/App/viewmodels/liveexample",
"C:/DWASFiles/Sites/socialplay/VirtualDirectory0/site/repository/DeveloperPortal/App/viewmodels/loginRegister",
"C:/DWASFiles/Sites/socialplay/VirtualDirectory0/site/repository/DeveloperPortal/App/viewmodels/sdk",
"C:/DWASFiles/Sites/socialplay/VirtualDirectory0/site/repository/DeveloperPortal/App/viewmodels/shell",
"C:/DWASFiles/Sites/socialplay/VirtualDirectory0/site/repository/DeveloperPortal/App/viewmodels/tutorials",
"C:/DWASFiles/Sites/socialplay/VirtualDirectory0/site/repository/DeveloperPortal/App/viewmodels/Instantiated/instantiated",
"C:/DWASFiles/Sites/socialplay/VirtualDirectory0/site/repository/DeveloperPortal/App/viewmodels/ItemCreationWizard/itemCreationWizard",
"C:/DWASFiles/Sites/socialplay/VirtualDirectory0/site/repository/DeveloperPortal/App/viewmodels/WorldWizard/worldWizard",
"text!C:/DWASFiles/Sites/socialplay/VirtualDirectory0/site/repository/DeveloperPortal/App/views/appdetails.html",
"text!C:/DWASFiles/Sites/socialplay/VirtualDirectory0/site/repository/DeveloperPortal/App/views/baseitems.html",
"text!C:/DWASFiles/Sites/socialplay/VirtualDirectory0/site/repository/DeveloperPortal/App/views/classes.html",
"text!C:/DWASFiles/Sites/socialplay/VirtualDirectory0/site/repository/DeveloperPortal/App/views/devmenu.html",
"text!C:/DWASFiles/Sites/socialplay/VirtualDirectory0/site/repository/DeveloperPortal/App/views/documentation.html",
"text!C:/DWASFiles/Sites/socialplay/VirtualDirectory0/site/repository/DeveloperPortal/App/views/footer.html",
"text!C:/DWASFiles/Sites/socialplay/VirtualDirectory0/site/repository/DeveloperPortal/App/views/games.html",
"text!C:/DWASFiles/Sites/socialplay/VirtualDirectory0/site/repository/DeveloperPortal/App/views/home.html",
"text!C:/DWASFiles/Sites/socialplay/VirtualDirectory0/site/repository/DeveloperPortal/App/views/HomeGuest.html",
"text!C:/DWASFiles/Sites/socialplay/VirtualDirectory0/site/repository/DeveloperPortal/App/views/items.html",
"text!C:/DWASFiles/Sites/socialplay/VirtualDirectory0/site/repository/DeveloperPortal/App/views/itemstore.html",
"text!C:/DWASFiles/Sites/socialplay/VirtualDirectory0/site/repository/DeveloperPortal/App/views/liveexample.html",
"text!C:/DWASFiles/Sites/socialplay/VirtualDirectory0/site/repository/DeveloperPortal/App/views/loginRegister.html",
"text!C:/DWASFiles/Sites/socialplay/VirtualDirectory0/site/repository/DeveloperPortal/App/views/nav.html",
"text!C:/DWASFiles/Sites/socialplay/VirtualDirectory0/site/repository/DeveloperPortal/App/views/sdk.html",
"text!C:/DWASFiles/Sites/socialplay/VirtualDirectory0/site/repository/DeveloperPortal/App/views/shell.html",
"text!C:/DWASFiles/Sites/socialplay/VirtualDirectory0/site/repository/DeveloperPortal/App/views/titleBar.html",
"text!C:/DWASFiles/Sites/socialplay/VirtualDirectory0/site/repository/DeveloperPortal/App/views/tutorials.html",
"text!C:/DWASFiles/Sites/socialplay/VirtualDirectory0/site/repository/DeveloperPortal/App/views/Instantiated/givePlayerItem.html",
"text!C:/DWASFiles/Sites/socialplay/VirtualDirectory0/site/repository/DeveloperPortal/App/views/Instantiated/instantiated.html",
"text!C:/DWASFiles/Sites/socialplay/VirtualDirectory0/site/repository/DeveloperPortal/App/views/Instantiated/playerSelect.html",
"text!C:/DWASFiles/Sites/socialplay/VirtualDirectory0/site/repository/DeveloperPortal/App/views/Instantiated/playersItems.html",
"text!C:/DWASFiles/Sites/socialplay/VirtualDirectory0/site/repository/DeveloperPortal/App/views/ItemCreationWizard/baseitembehaviours.html",
"text!C:/DWASFiles/Sites/socialplay/VirtualDirectory0/site/repository/DeveloperPortal/App/views/ItemCreationWizard/baseitemimage.html",
"text!C:/DWASFiles/Sites/socialplay/VirtualDirectory0/site/repository/DeveloperPortal/App/views/ItemCreationWizard/baseItemname.html",
"text!C:/DWASFiles/Sites/socialplay/VirtualDirectory0/site/repository/DeveloperPortal/App/views/ItemCreationWizard/baseitemproperties.html",
"text!C:/DWASFiles/Sites/socialplay/VirtualDirectory0/site/repository/DeveloperPortal/App/views/ItemCreationWizard/baseitemquality.html",
"text!C:/DWASFiles/Sites/socialplay/VirtualDirectory0/site/repository/DeveloperPortal/App/views/ItemCreationWizard/baseitemunity3d.html",
"text!C:/DWASFiles/Sites/socialplay/VirtualDirectory0/site/repository/DeveloperPortal/App/views/ItemCreationWizard/baseitemvariations.html",
"text!C:/DWASFiles/Sites/socialplay/VirtualDirectory0/site/repository/DeveloperPortal/App/views/ItemCreationWizard/classbehaviours.html",
"text!C:/DWASFiles/Sites/socialplay/VirtualDirectory0/site/repository/DeveloperPortal/App/views/ItemCreationWizard/classname.html",
"text!C:/DWASFiles/Sites/socialplay/VirtualDirectory0/site/repository/DeveloperPortal/App/views/ItemCreationWizard/classproperties.html",
"text!C:/DWASFiles/Sites/socialplay/VirtualDirectory0/site/repository/DeveloperPortal/App/views/ItemCreationWizard/classselect.html",
"text!C:/DWASFiles/Sites/socialplay/VirtualDirectory0/site/repository/DeveloperPortal/App/views/ItemCreationWizard/generateditems.html",
"text!C:/DWASFiles/Sites/socialplay/VirtualDirectory0/site/repository/DeveloperPortal/App/views/ItemCreationWizard/helppage.html",
"text!C:/DWASFiles/Sites/socialplay/VirtualDirectory0/site/repository/DeveloperPortal/App/views/ItemCreationWizard/itemCreationWizard.html",
"text!C:/DWASFiles/Sites/socialplay/VirtualDirectory0/site/repository/DeveloperPortal/App/views/WorldWizard/worldWizard.html",
"text!C:/DWASFiles/Sites/socialplay/VirtualDirectory0/site/repository/DeveloperPortal/App/views/WorldWizard/worldWizard_App.html",
"text!C:/DWASFiles/Sites/socialplay/VirtualDirectory0/site/repository/DeveloperPortal/App/views/WorldWizard/worldWizard_Currency.html",
"text!C:/DWASFiles/Sites/socialplay/VirtualDirectory0/site/repository/DeveloperPortal/App/views/WorldWizard/worldWizard_World.html"
],
"exclude": [],
"keepBuildDir": true,
"optimize": "uglify2",
"out": "C:\\DWASFiles\\Sites\\socialplay\\VirtualDirectory0\\site\\repository\\DeveloperPortal\\App\\main-built.js",
"pragmas": {
"build": true
},
"wrap": true,
"insertRequire": [
"main"
]
}
Deleting old output file.
Tracing dependencies for: durandal/amd/almond-custom
KuduSync.NET from: 'C:\DWASFiles\Sites\socialplay\Temp\8bdcc230-a749-42d9-9b04-dfb7f84a5bf1' to: 'C:\DWASFiles\Sites\socialplay\VirtualDirectory0\site\wwwroot'
Copying file: 'Web.config'
Finished successfully.
似乎很好,但看起来,KuduSync 可能正在替换 durandal 生成的文件,所以我在 deploy.cmd 的第 2 步尝试引用 %DEPLOYMENT_TEMP%,
:: 2. Durandal Node js Optimize
echo 运行 Durandal 优化器 %DEPLOYMENT_SOURCE%\DeveloperPortal\App\durandal\amd\optimizer --source %DEPLOYMENT_TEMP%\App\
最终在这里发生的是 main-built.js 是空的,并且我的页面没有加载。
这就是我卡住的地方