Using Perforce workspaces effectively with Bamboo

My employer uses Perforce and Bamboo in our continuous integration environment and we have a persistent problem with Perforce workspaces: they are a pain to maintain!

Our environment is set up like this:

  • 1 Perforce server, 100s of depots, 10s of projects per depot. Sometimes projects use code from multiple depots.
  • Developers maintain their own workspaces for their local machines.
  • Workspaces are created for Bamboo build plans.
  • Bamboo workspaces include only the paths necessary to build a project.
  • Often a single build plan has multiple workspaces due to the way Bamboo and Perforce interact. Parallel jobs cannot use the same workspace, since Bamboo sets the workspace root to match the build agent.
  • Build plan branches also get their own workspaces.
  • Any time developers want to add a location to the workspace they need to update many workspaces. It's annoying and easy to mess up.

    Is there any way to reduce the number of workspaces? Are there changes we can make to the way we structure things to make maintenance easier?


    The simplest solution would be to use streams, which are essentially dynamic workspace templates.

    A stream defines a set of depot paths, and a workspace can be linked to a stream rather than having a manually specified view. When a stream is updated, all workspaces that are linked to it are instantly updated to match. So if your projects were defined as streams, a developer updating the project would trigger automatic updates in all of the build workspaces that point to the same stream.

    The manual alternative is to designate a master client workspace for each project to use as a template, and use the "p4 client -t" command to copy its view -- the trick is that this won't happen automatically as it does for stream workspaces, so you'd probably want to set up your own automation on the build system to make sure its workspace is up to date.

    链接地址: http://www.djcxy.com/p/63216.html

    上一篇: 使用生成的Jenkins工件进行Bamboo部署

    下一篇: 有效地使用Perforce工作区和Bamboo