- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我们使用 TFSDeployer 来监听构建质量的变化,并在过渡到“暂存”时部署到我们的暂存环境。
我想让它继续进行,并将当前构建质量为“暂存”的所有其他构建更新为“已拒绝”。
这似乎是需要在 PowerShell 脚本中发生的事情,如下所示:
$droplocation = $TfsDeployerBuildData.DropLocation
ECHO $droplocation
$websourcepath = $droplocation + "\Release\_PublishedWebsites\CS.Public.WebApplication\"
$webdestinationpath = "\\vmwebstg\WebRoot\CreditSolutions\"
new-item -force -path $webdestinationpath -itemtype "directory"
get-childitem $webdestinationpath | remove-item -force -recurse
get-childitem $websourcepath | copy-item -force -recurse -destination $webdestinationpath
$configFile = $webdestinationpath + "web.development.config"
remove-item $configFile -force
$configFile = $webdestinationpath + "web.staging.config"
$configFileDest = $webdestinationpath + "web.config"
move-item $configFile $configFileDest -force
那么,我该怎么做呢?
最佳答案
首先将 Get-tfs 函数添加到您的脚本中:
function get-tfs (
[string] $serverName = $(Throw 'serverName is required')
)
{
# load the required dll
[void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.TeamFoundation.Client")
$propertiesToAdd = (
('VCS', 'Microsoft.TeamFoundation.VersionControl.Client', 'Microsoft.TeamFoundation.VersionControl.Client.VersionControlServer'),
('WIT', 'Microsoft.TeamFoundation.WorkItemTracking.Client', 'Microsoft.TeamFoundation.WorkItemTracking.Client.WorkItemStore'),
('BS', 'Microsoft.TeamFoundation.Build.Common', 'Microsoft.TeamFoundation.Build.Proxy.BuildStore'),
('CSS', 'Microsoft.TeamFoundation', 'Microsoft.TeamFoundation.Server.ICommonStructureService'),
('GSS', 'Microsoft.TeamFoundation', 'Microsoft.TeamFoundation.Server.IGroupSecurityService')
)
# fetch the TFS instance, but add some useful properties to make life easier
# Make sure to "promote" it to a psobject now to make later modification easier
[psobject] $tfs = [Microsoft.TeamFoundation.Client.TeamFoundationServerFactory]::GetServer($serverName)
foreach ($entry in $propertiesToAdd) {
$scriptBlock = '
[System.Reflection.Assembly]::LoadWithPartialName("{0}") > $null
$this.GetService([{1}])
' -f $entry[1],$entry[2]
$tfs | add-member scriptproperty $entry[0] $ExecutionContext.InvokeCommand.NewScriptBlock($scriptBlock)
}
return $tfs
}
接下来,实例化TFS对象
$tfs = get-tfs http://YourTfsServer:8080
然后找到构建质量为“Staging”的构建
$builds = $tfs.BS.GetListOfBuilds("Test Project", "TestBuild") |
where {$_.BuildQuality -eq "Staging"}
最后,更新这些构建的质量
foreach ($build in $builds) { $tfs.BS.UpdateBuildQuality($build.BuildUri, "Rejected") }
(我还没有运行这个脚本,但你应该能够顺利运行它)
更多信息在我的博客上:Using the Team Foundation Object Model with PowerShell
最后一个建议,如果您从 TfsDeployer 运行的脚本中更新构建质量,如果您有暂存的映射 --> 拒绝转换,您最终可能会同时运行 2 个脚本!
关于tfs - 如何使用 PowerShell 更新以前 TFS 构建的构建质量?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/579132/
管理项目时,我可以在团队项目级别编辑权限。 Web 界面允许管理: 团队 TFS 组 但是,我找不到有关这些不同之处的任何指导。根据经验,我希望一个团队成为多个 TFS 组的一部分,但似乎一个团队可以
如何从 http://tfs.visualstudio.com 上托管的 TFS 迁移到本地版本的 TFS?我想用Visual Studio Team Foundation Server Expres
在 Team Foundation (TFS2017) 上,您可以连接到 TFS 实例的构建代理的最大数量是多少? 最佳答案 目前还没有任何官方文档声明 TFS 构建代理数量的限制。也没有得到任何相关
我试图了解 TFS 2008(和 2010,如果它不同)如何存储和传达变更集中一组更改的详细信息。 现在,当我提交一个 Subversion 托管项目时,客户端会将差异发送到服务器。因此,如果我添加了
基本上,我有 2 个构建定义,一个构建和部署一些数据库项目,另一个构建和部署网站。 我想做的是能够构建/部署数据库,如果没有任何错误,则构建和部署网络应用程序。 这个想法是,如果数据库部署由于某种原因
我们有一个 CI 构建服务器进行自动构建,并希望在程序集版本中包含当前的冲刺/迭代编号。是否有环境变量或简单的方法可以在构建过程中获取当前的冲刺编号? TFS On Permise 2015 更新 3
我正在探索在我们的下一个项目中使用 TFS 进行软件过程的可行性。一种需求是能够从 TFS 中的各个链接需求创建需求文档。我目前在 Agile 和 CMMI 中都有模型项目,其中有一组与父子关系相关的
我的公司有一个本地 TFS 2017 实例。我知道如何通过 Web 界面安装和更新扩展程序,但这很乏味。我想知道是否有更快的方法来使用 tfs-cli . 最佳答案 由于某种原因,我花了一段时间才弄清
关闭。这个问题不满足Stack Overflow guidelines .它目前不接受答案。 想改善这个问题吗?更新问题,使其成为 on-topic对于堆栈溢出。 3年前关闭。 Improve thi
似乎没有太多关于团队管理员的文档,但是如果我进入我的团队页面并在左侧添加一个用户作为管理员,这并没有让他们成为项目管理员,只是一个叫做团队管理员。有权限的团队管理员和项目管理员有什么区别? 最佳答案
我们计划从 Tfs 2012 升级到 Tfs 2013。谁能帮助我了解它们之间的流程模板差异?我们将所有三个流程模板用于不同的项目。 最佳答案 变化非常小,除了: 引入投资组合积压。 测试计划和测试套
我们已经成功构建了 TFS 2010 基础架构和第一个使用 Visual Studio 2010 的虚拟机。现在我有一个非常简单的问题。如何将解决方案从我们现有的 TFS 2008 转移到新的 201
我们公司正在使用 Team Foundation Server 2015。是否可以在每个拉取请求中自动添加一个或几个人作为审阅者?作为必需的默认审阅者? 最佳答案 是的,您可以很容易地将默认审阅者添加
通过管理员帐户导航到 TFS 2013 集合的项目页面返回此错误: http://server:8080/tfs/DMS/ProjectX Error The page you are looking
TFS 中等效的拉取请求是什么? 我特别询问跨团队协作,其中有一个团队负责产品,但其他团队可以处理自己的副本并提交“拉取请求”。 所以核心团队仍然拥有产品,但其他团队仍然可以为它做出贡献。 最佳答案
当尝试将项目的较新版本与较旧版本合并时,我得到“该项目已在目标分支中删除”,它给了我三个选项: Restore File And AutoMerge Keep Target Branch Versio
我必须将一个项目恢复到上周的版本。所以我按日期得到了一个特定的版本,但是现在如果我在文件中添加一个空格,它会 check out 并获得最新版本。 我去了工具 -> 选项 -> 源代码控制 -> VS
如何在没有 Visual Studio 的情况下将 VS 项目添加到源代码管理 (TFS)?我还获得了对 tfs 项目的 Web 访问权限,但我没有看到任何上传选项或创建子项目选项(我看到我的主项
我只是想知道是否有一种方法可以分析 TFS,以找出针对特定开发人员的代码覆盖率结果。 假设我想确定我团队中一位开发人员的代码覆盖率统计数据。 最佳答案 它不支持开箱即用。 不要认为它会在 future
我想使用尚未映射到 TFS 中的工作项的 .MPP MS Project 2007 计划,TFS 项目是空的,我的意思是根本没有工作项。我要同步 http://localhost:8080/tfs/这
我是一名优秀的程序员,十分优秀!