【发布时间】:2020-01-27 22:15:32
【问题描述】:
我正在使用 TFS 2015 Release 将构建部署到 DEV、QA 和 UAT 环境。 我正在部署一个 C# WPF 应用程序。
- 我已对包含的数据库项目进行了更改,现在我已将“.sql”脚本添加到 我的 Visual Studio 解决方案中的输出目录。我检查 更改,构建通过。
- 我在发布管道中创建了一个新版本,并使用新的 已创建构建。
- 问题:我的发布管道未能在发布上部署 步骤“下载工件”。
我需要新包含的“.sql”文件来扩展我们的发布管道,因此我需要找到一种方法来包含这些文件。
这是从失败的部署步骤获取的“下载 artifacts.log” 文件。在新包含的“.sql”文件之前,此步骤将通过。
2019-09-27T12:43:12.0760185Z Cleaning artifacts directory: C:\ST-BuildAgent\AgentA\9d128ed82…
2019-09-27T12:43:12.2244465Z Cleaned artifacts directory: C:\ST-BuildAgent\AgentA\9d128ed82
2019-09-27T12:43:12.2263995Z Number of linked artifacts to download: 2
2019-09-27T12:43:12.2273760Z Starting artifacts download...
2019-09-27T12:43:12.2390940Z Downloading linked artifact: Application Main - Continuous...
2019-09-27T12:43:12.2390940Z Downloading artifact of type: Build
2019-09-27T12:43:12.2400705Z Created artifact folder C:\ST-BuildAgent\AgentA\9d128ed82\Application Main - Continuous
2019-09-27T12:43:12.2527650Z Preparing to get the list of available artifacts from build.
2019-09-27T12:43:12.3631095Z Preparing to download artifact: Application Main - Continuous_20190927.2
2019-09-27T12:43:12.3699450Z Artifact Type: FileShare
2019-09-27T12:43:14.8404900Z Preparing to get the list of available artifacts from build.
2019-09-27T12:43:14.8854090Z Preparing to download artifact: Application Main - Continuous_20190927.2
2019-09-27T12:43:14.8854090Z Artifact Type: FileShare
2019-09-27T12:43:15.9234285Z Preparing to get the list of available artifacts from build.
2019-09-27T12:43:15.9790890Z Preparing to download artifact: Application Main - Continuous_20190927.2
2019-09-27T12:43:15.9790890Z Artifact Type: FileShare
2019-09-27T12:43:17.0171085Z Preparing to get the list of available artifacts from build.
2019-09-27T12:43:17.0551920Z Preparing to download artifact: Application Main - Continuous_20190927.2
2019-09-27T12:43:17.0551920Z Artifact Type: FileShare
2019-09-27T12:43:18.0912585Z Preparing to get the list of available artifacts from build.
2019-09-27T12:43:18.1518015Z Preparing to download artifact: Application Main - Continuous_20190927.2
2019-09-27T12:43:18.1518015Z Artifact Type: FileShare
2019-09-27T12:43:18.1879320Z Error: System.IO.FileNotFoundException: Unable to find the specified file.
2019-09-27T12:43:18.1879320Z at Microsoft.TeamFoundation.Release.Windows.Implementation.FileSystemFile..ctor(String fullPath)
2019-09-27T12:43:18.1889085Z at Microsoft.TeamFoundation.Release.Windows.Implementation.FileSystemDirectory.<>c.<GetFiles>b__8_0(String fullPath)
2019-09-27T12:43:18.1889085Z at System.Linq.Enumerable.<>c__DisplayClass7_0`3.<CombineSelectors>b__0(TSource x)
2019-09-27T12:43:18.1889085Z at System.Linq.Enumerable.WhereSelectArrayIterator`2.MoveNext()
2019-09-27T12:43:18.1889085Z at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
2019-09-27T12:43:18.1898850Z at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
2019-09-27T12:43:18.1898850Z at Microsoft.TeamFoundation.DevOps.Diagnostics.DiagnosticsPolicyExecutor.Execute[T](Func`1 func, String methodName)
2019-09-27T12:43:18.1898850Z at Microsoft.TeamFoundation.Release.ArtifactRepository.FileShare.FileShareArtifact.DownloadArtifact(ArtifactDefinition artifactDefinition, String dropLocation, String localFolderPath)
2019-09-27T12:43:18.1898850Z at Microsoft.TeamFoundation.Release.ArtifactRepository.Build.BuildArtifact.DownloadArtifact(BuildArtifact buildArtifact, ArtifactDefinition artifactDefinition, String localFolderPath, BuildHttpClient buildClient, Int32 buildId)
2019-09-27T12:43:18.1908615Z at Microsoft.TeamFoundation.Release.ArtifactRepository.Build.BuildArtifact.Download(ArtifactDefinition artifactDefinition, String localFolderPath)
2019-09-27T12:43:18.1908615Z at Microsoft.TeamFoundation.Release.ArtifactRepository.Common.AgentArtifactDownloader.Download(ArtifactDefinition artifactDefinition, Uri workingFolder)
2019-09-27T12:43:18.1908615Z at Microsoft.TeamFoundation.DistributedTask.Plugin.Release.ReleaseJobExtension.<>c__DisplayClass19_0.<DownloadArtifacts>b__0()
2019-09-27T12:43:18.1908615Z at Microsoft.TeamFoundation.Release.Windows.Implementation.RetryExecutor.Execute(Action action)
2019-09-27T12:43:18.1918380Z at Microsoft.TeamFoundation.DistributedTask.Plugin.Release.ReleaseJobExtension.DownloadArtifacts(ITaskContext downloadArtifactTaskContext, IJobContext context, IList`1 agentArtifactDefinitions, Uri artifactsWorkingFolder, String teamProjectId, IDictionary`2 savedSettings)
2019-09-27T12:43:18.1918380Z at Microsoft.TeamFoundation.DistributedTask.Plugin.Release.ReleaseJobExtension.DownloadArtifactsWrapper(IJobContext context, IJobRequest job, CancellationToken cancellationToken, ITaskContext downloadArtifactTaskContext, String teamProjectId, Uri artifactsWorkingFolder, Int32 releaseId, IDictionary`2 savedSettings)
我的尝试 我已经撤消了我的代码更改,签入了更改,构建了应用程序,并成功发布了应用程序。在下载工件步骤中成功。
我尝试了两种不同的方法将“.sql”脚本文件放入构建工件文件夹中
- 我在数据库的构建后事件中使用了 XCOPY 命令 将特定文件复制到的构建输出路径的项目 应用程序。
- 或者,我尝试手动更改“.sql”文件设置 复制到输出目录到总是复制
这两种技术都将我想要的文件复制到构建工件中。
请让我知道接下来我应该尝试什么。 谢谢
【问题讨论】:
-
不要发布到文件共享。更改它以将文件存储在 TFS 实例中。另外,请考虑升级到不到 5 年的 TFS 版本。
-
@DanielMann 将文件发布到文件共享有什么问题?作为自动化 CI 构建的一个步骤,我们将构建和工件发布到文件共享。这样,我们可以将工件用于发布定义或在不同的 QA 系统上手动安装构建。我们也在升级到 DevOps 2019。
标签: tfs msbuild tfs-2015 azure-pipelines-release-pipeline release-management