Como ser um bom administrador de team foundation server vinicius moura

965 views
814 views

Published on

Palestra do ALM Summit Brasil 2014

Published in: Technology
0 Comments
4 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
965
On SlideShare
0
From Embeds
0
Number of Embeds
36
Actions
Shares
0
Downloads
11
Comments
0
Likes
4
Embeds 0
No embeds

No notes for slide

Como ser um bom administrador de team foundation server vinicius moura

  1. 1. ALM Summit Brasil 2014 ALM Summit Brasil 2014 Como ser um bom administrador de Team Foundation Server Vinicius Moura vinicius.moura@lambda3.com.br @vinijmoura ALM Rangers MCSD ALM
  2. 2. ALM Summit Brasil 2014 Para aprender e/ou recordar API Camada de Dados (“Data Tier”) Camada de Aplicação (“Application Tier”) Camada de Cliente (“Client Tier”) Visual Studio Eclipse Windows Explorer Linha de comando Microsoft Excel Microsoft Project Aplicações
  3. 3. ALM Summit Brasil 2014 Como administrar um ou mais servidor(es) de vários “pais”? Data Tier App Tier Proxy Server Build Server O que eu faço com esse monte de servidores?
  4. 4. ALM Summit Brasil 2014 Backup das bases de dados • Cenário 2 – Backup Admin Console • Cenário 1 – Backup Trivial • Tfs_Configuration • Tfs_Collection – 1 à “N” • Tfs_Warehouse • ReportServer (2 bases) • SharePoint (3 bases) Vamos facilitar a sua vida? http://msdn.microsoft.com/en-us/library/hh561429.aspx
  5. 5. ALM Summit Brasil 2014 Process Templates Dica importante: faça o versionamento do Process Template da sua empresa
  6. 6. ALM Summit Brasil 2014 Process Templates Cenário do caos: Eu preciso atualizar 700 Team Projects para a inclusão de um novo campo no Work Item Type Bug • Resolução 1 – Utilizar o Process Template Editor e repetir o processo 700 vezes ;-)
  7. 7. ALM Summit Brasil 2014 Process Templates • Resolução 2 – Utilizar a ferramenta TFS Administrators Toolkit http://visualstudiogallery.msdn.microsoft.com/33713c5d -31a3-44b3-ae94-3c413e6b21c7
  8. 8. ALM Summit Brasil 2014 Process Templates • Resolução 3 – Linha de comando witadmin importwitd Select na tabela tbl_Project da tfs_Collection Salvar os nomes dos Team Projects em um arquivo txt Executar a linha de comando witadmin importwitd
  9. 9. ALM Summit Brasil 2014 Process Templates witadmin importwitd /collection:collectionurl [/p:project] /f:filename /v FOR /F "tokens=1" %i in (C:tempprojetos.txt) DO witadmin importwitd /collection:http://vinimoura-pc: 8080/tfs/DefaulCollection /p:%i /f:"D:DesktopMicrosoft Visual Studio Scrum 2013.3WorkItem TrackingTypeDefinitionsBug.xml" /v > C:temp%i.txt
  10. 10. ALM Summit Brasil 2014 Grupos e Usuários Permissionamento de usuários TFSSecurity /imx <identity> /collection:http://myservertfs:8080/tfs/Collec tion
  11. 11. ALM Summit Brasil 2014 Grupos e Usuários Auditoria de usuários no TFS 2013
  12. 12. ALM Summit Brasil 2014 A tabela tbl_command • Tabela de acessos ao TFS • Command • Start Time • Execution Time • IdentityName • IP • UserAgent A tabela tbl_command é limpa a cada 14 dias :(
  13. 13. ALM Summit Brasil 2014 A tabela tbl_command Cenário 1: Como listar as versões de Visual Studio que se conectam ao meu TFS? SELECT DISTINCT UserAgent FROM tbl_Command ORDER BY UserAgent
  14. 14. ALM Summit Brasil 2014 A tabela tbl_command Cenário 2: Performance dos comandos executados
  15. 15. ALM Summit Brasil 2014 Scripts Power Shell Cenário 1: Criar branches param( [string] $ServerFolderLocation ) if ( (Get-PSSnapin -Name Microsoft.TeamFoundation.PowerShell -ErrorAction SilentlyContinue) -eq $null ) { Add-PSSnapin Microsoft.TeamFoundation.PowerShell } $CollectionURI="http://myserver/tfs/myCollection" $tfs=Get-TfsServer -name $CollectionURI $TfExePath = "C:Program FilesMicrosoft Visual Studio 12.0Common7IDETF.exe" $match="TRUNK" foreach ($item in Get-TfsChildItem $ServerFolderLocation -f -r -server $tfs) { if ($item -match $match) { $branchpath = $item.ServerItem -replace "TRUNK", "BRANCHES" $branchpath = $branchpath & "$TfExePath" branch $item.ServerItem $branchpath /version:T /checkin /comment:"Created Branch" } }
  16. 16. ALM Summit Brasil 2014 Scripts Power Shell Cenário 2: Converter pastas em branches param( [string] $ServerFolderLocation ) if ( (Get-PSSnapin -Name Microsoft.TeamFoundation.PowerShell -ErrorAction SilentlyContinue) -eq $null ) { Add-PSSnapin Microsoft.TeamFoundation.PowerShell } $CollectionURI="http://myserver/tfs/myCollection" $tfs=Get-TfsServer -name $CollectionURI $TfptExePath = "C:Program FilesMicrosoft Team Foundation Server 2013 Power ToolsTFPT.exe" $match="TRUNK" foreach ($item in Get-TfsChildItem $ServerFolderLocation -f -r -server $tfs) { if ($item -match $match) { & "$TfptExePath" branches /convertToBranch /collection:$CollectionURI /description:"Convert to Branch" $item.ServerItem } }
  17. 17. ALM Summit Brasil 2014 Scripts Power Shell Cenário 3: Criar work Itens param( [string] $ServerFolderLocation ) if ( (Get-PSSnapin -Name Microsoft.TeamFoundation.PowerShell -ErrorAction SilentlyContinue) -eq $null ) { Add-PSSnapin Microsoft.TeamFoundation.PowerShell } $CollectionURI="http://myserver/tfs/myCollection" $tfs=Get-TfsServer -name $CollectionURI $TfptExePath = "C:Program FilesMicrosoft Team Foundation Server 2013 Power ToolsTFPT.exe" $match=“BRANCHES" foreach ($item in Get-TfsChildItem $ServerFolderLocation -f -r -server $tfs) { if ($item -match $match) { $title = $item.ServerItem $description = "Primeiro checkin - " + $title & "$TfptExePath" workitem /new myProjectUser Story /collection:$CollectionURI /Fields:"Title=$title;Description=$description" } }
  18. 18. ALM Summit Brasil 2014 Scripts Power Shell Cenário 4: Permissionamento de Pastas param( [string] $ServerFolderLocation ) if ( (Get-PSSnapin -Name Microsoft.TeamFoundation.PowerShell -ErrorAction SilentlyContinue) -eq $null ) { Add-PSSnapin Microsoft.TeamFoundation.PowerShell } $CollectionURI="http://myserver/tfs/myCollection" $tfs=Get-TfsServer -name $CollectionURI $TfExePath = "C:Program FilesMicrosoft Visual Studio 12.0Common7IDETF.exe" $match="BRANCHES" foreach ($item in Get-TfsChildItem $ServerFolderLocation -f -r -server $tfs) { if ($item -match $match) { & "$TfExePath" permission /allow:"checkin,pendchange,merge" /group:Contributors/collection:$CollectionURI $item.ServerItem } }
  19. 19. ALM Summit Brasil 2014 Gerenciamento de Builds Cenário 1: Meu build controller morreu e preciso executar o reapontamento de 200 Build Definitions TFS Community Build Manager - http://visualstudiogallery.msdn.microsoft.com/73bf2d8e-aec6- 406c-8e7f-1c678e46557f
  20. 20. ALM Summit Brasil 2014 O “rei” dos Plug-ins – Neno Loje tfsRefresWarehouse tfsSyncIdentities http://blogs.msmvps.com/vstsblog/2014/05/05/upd ated-tools-for-tfs-2013/
  21. 21. ALM Summit Brasil 2014 ALM Rangers • Solutions – http://aka.ms/vsarsolutions • Widgets – http://aka.ms/widgets
  22. 22. ALM Summit Brasil 2014 ALM Summit Brasil 2014 Obrigado! vinicius.moura@lambda3.com.br @vinijmoura http://blog.lambda3.com.br/L3/viniciusmoura/

×