【发布时间】:2016-05-24 17:26:07
【问题描述】:
我有一个大致如下的项目结构
Root
MyProject.Web
App
js
sass
img
other stuff..
other stuff...
other stuff...
由于某种原因,msdeploy 突然停止复制我的sass 目录。我从经验中知道要检查的一些事情:
- 它包含在 csproj 中。这是通过 App 目录
<Content Include="App\**\*" />上的通配符完成的。我已经在几个项目中使用了它,实际上它之前在 this 项目中使用过。 - 它正在在 webdeploy 的
CollectFilesFromContent步骤中列出。
但在CopyAllFilesToSingleFolderForMsdeploy 步骤中却被省略了
我通过使用以下参数将 MsBuild 指向 MyProject.Web.csproj 从 CI 启动它
/p:DeployTarget=MSDeployPublish /p:Configuration=QA /p:MsDeployServiceUrl="https://${bamboo.deployServer}:8172/MsDeploy.axd";DeployIisAppPath="${bamboo.deploySite}";username="${bamboo.deployUser}";password="${bamboo.deployPassword}" /p:SolutionDir=${bamboo.build.working.directory}\ /p:DeployOnBuild=True /p:MSDeployPublishMethod=WMSVC /p:AllowUntrustedCertificate=True /p:AllowUnsafeBlocks=true
这是我的日志的截断副本,应该可以证明我在说什么
build 12-Feb-2016 18:57:04 CollectFilesFromContent:
build 12-Feb-2016 18:57:04 Gather all files from Project items @(Content). Adding:
build 12-Feb-2016 18:57:04
App\img\loading.gif;
<...snip...>
App\js\app.js;
App\js\directives\adminNavigation.js;
<...snip...>
App\js\screens\myTime\listView.html;
<...snip...>
App\sass\admin.css;
App\sass\admin.scss;
App\sass\home.css;
App\sass\home.scss;
App\sass\lib\_normalize.scss;
App\sass\login.css;
App\sass\login.scss;
<...snip...>
build 12-Feb-2016 18:57:04 CollectFilesFromIntermediateSatelliteAssembliesWithTargetPath:
build 12-Feb-2016 18:57:04 Gather all files from Project output (IntermediateSatelliteAssembliesWithTargetPath). Adding:
build 12-Feb-2016 18:57:04 CollectFilesFromReference:
build 12-Feb-2016 18:57:04 Gather all files from Project items @(ReferenceCopyLocalPaths,ReferenceComWrappersToCopyLocal,ResolvedIsolatedComModules,_DeploymentLooseManifestFile,NativeReferenceFile).
build 12-Feb-2016 18:57:04 CollectFilesFromAllExtraReferenceFiles:
build 12-Feb-2016 18:57:04 Gather all files from Project items @(AllExtraReferenceFiles). Adding:
build 12-Feb-2016 18:57:04 CollectFilesFrom_SourceItemsToCopyToOutputDirectory:
build 12-Feb-2016 18:57:04 Gather all files from Project items @(_SourceItemsToCopyToOutputDirectoryAlways,_SourceItemsToCopyToOutputDirectory). Adding:
build 12-Feb-2016 18:57:04 bin\Version.txt
build 12-Feb-2016 18:57:04 CollectFilesFrom_binDeployableAssemblies:
build 12-Feb-2016 18:57:04 Gather all files from Project items @(_binDeployableAssemblies). Adding:
build 12-Feb-2016 18:57:05 PipelineCollectFilesPhase:
build 12-Feb-2016 18:57:05 Publish Pipeline Collect Files Phase
build 12-Feb-2016 18:57:05 PreTransformWebConfig:
build 12-Feb-2016 18:57:05 Found The following for Config tranformation:
build 12-Feb-2016 18:57:05 Web.config
build 12-Feb-2016 18:57:05 Creating directory "E:\CI_BUILD_DIRECTORY\obj\QA\TransformWebConfig\transformed\".
build 12-Feb-2016 18:57:05 Creating directory "E:\CI_BUILD_DIRECTORY\obj\QA\TransformWebConfig\transformed\Views\".
build 12-Feb-2016 18:57:05 Copying Web.config to obj\QA\TransformWebConfig\original\Web.config.
build 12-Feb-2016 18:57:05 Copying E:\CI_BUILD_DIRECTORY\Web.QA.config to obj\QA\TransformWebConfig\assist\Web.config.
build 12-Feb-2016 18:57:05 TransformWebConfigCore:
<...snip...>
build 12-Feb-2016 18:57:05 Transformation succeeded
build 12-Feb-2016 18:57:05 PostTransformWebConfig:
build 12-Feb-2016 18:57:05 Transformed Web.config using E:\CI_BUILD_DIRECTORY\Web.QA.config into obj\QA\TransformWebConfig\transformed\Web.config.
build 12-Feb-2016 18:57:05 PipelineTransformPhase:
build 12-Feb-2016 18:57:05 Publish Pipeline Transform Phase
build 12-Feb-2016 18:57:05 PreAutoParameterizationWebConfigConnectionStrings:
build 12-Feb-2016 18:57:05 Creating directory "E:\CI_BUILD_DIRECTORY\obj\QA\CSAutoParameterize\transformed\Views\".
build 12-Feb-2016 18:57:05 Copying Views\Web.config to obj\QA\CSAutoParameterize\original\Views\Web.config.
build 12-Feb-2016 18:57:05 Copying obj\QA\TransformWebConfig\transformed\Web.config to obj\QA\CSAutoParameterize\original\Web.config.
build 12-Feb-2016 18:57:05 AutoParameterizationWebConfigConnectionStringsCore:
build 12-Feb-2016 18:57:05 Transforming Source File: E:\CI_BUILD_DIRECTORY\Views\Web.config
<...snip...>
build 12-Feb-2016 18:57:05 Transformation succeeded
build 12-Feb-2016 18:57:05 Transforming Source File: E:\CI_BUILD_DIRECTORY\obj\QA\TransformWebConfig\transformed\Web.config
build 12-Feb-2016 18:57:05 Applying Transform File: <?xml version="1.0"?>
<...snip...>
build 12-Feb-2016 18:57:05 Transformation succeeded
build 12-Feb-2016 18:57:05 PostAutoParameterizationWebConfigConnectionStrings:
build 12-Feb-2016 18:57:05 Auto ConnectionString Transformed Views\Web.config into obj\QA\CSAutoParameterize\transformed\Views\Web.config.
build 12-Feb-2016 18:57:05 Auto ConnectionString Transformed obj\QA\TransformWebConfig\transformed\Web.config into obj\QA\CSAutoParameterize\transformed\Web.config.
build 12-Feb-2016 18:57:05 PipelineMsdeploySpecificTransformPhase:
build 12-Feb-2016 18:57:05 Publish Pipeline Deploy phase Stage PipelineMsdeploySpecificTransformPhase
build 12-Feb-2016 18:57:05 CopyAllFilesToSingleFolderForMsdeploy:
build 12-Feb-2016 18:57:05 Creating directory "obj\QA\Package\PackageTmp".
build 12-Feb-2016 18:57:05 Copying all files to temporary location below for package/publish:
build 12-Feb-2016 18:57:05 obj\QA\Package\PackageTmp.
build 12-Feb-2016 18:57:05 Copying bin\MyProject.Web.dll to obj\QA\Package\PackageTmp\bin\MyProject.Web.dll.
build 12-Feb-2016 18:57:05 Copying bin\MyProject.Web.pdb to obj\QA\Package\PackageTmp\bin\MyProject.Web.pdb.
build 12-Feb-2016 18:57:05 Copying App\img\loading.gif to obj\QA\Package\PackageTmp\App\img\loading.gif.
<...snip...>
build 12-Feb-2016 18:57:05 Copying App\js\app.js to obj\QA\Package\PackageTmp\App\js\app.js.
build 12-Feb-2016 18:57:05 Copying App\js\directives\adminNavigation.js to obj\QA\Package\PackageTmp\App\js\directives\adminNavigation.js.
<...snip...>
build 12-Feb-2016 18:57:05 Copying App\js\screens\myTime\listView.html to obj\QA\Package\PackageTmp\App\js\screens\myTime\listView.html.
<...other files BUT NOT the sass directory...>
所以这个目录是为部署而收集的,但实际上并没有部署。我不知道如何进一步调试!
【问题讨论】:
-
您确定这些文件已更改吗?默认情况下,MSDeploy 仅部署更改的文件。您也可以尝试在本地部署或部署到不同的目标,看看是否会发生同样的问题。
-
@chief7 实际上是在源代码上删除它们,但这是一个绝妙的主意。在本地部署也不会部署这些文件!我不知道这意味着什么,但这大大缩短了我玩这个的反馈循环
标签: msbuild msdeploy webdeploy