1
votes

I have an issue that I want to share with you and ask for advice.

Let's say I have a project in TFS with a source code folders and folder with deployment scripts. Folders structure:

-- TFS

---- PROJECT

--------DEPLOYMENTSCRIPTS

--------SOURCE

DeploymentScripts folder is a container for custom deployment scripts that are being executed by TFS Build process.

Source - is a folder with a source code where for each new release I create a label to use it later for deployment.

I have a build definition configured to takes files from both folders, so I expect that TFS will download the content of both folders each time I trigger a build:

build definition - source settings

And this perfectly works when TFS build takes the latest version: it takes everything, builds and deploys.

The issue appears once I configure what label to take:

build definition - label

TFS downloads only the content of Source folder ignoring DeploymentScripts. I suppose that this happens because we use labels only for Source folder and not in DeploymetScripts (the content of this folder is static, there are no any changes). I know, that if I make DeploymentScripts a sub-folder of Sources that will fix my issue, but I want to keep it separate (for example, if I later create a bunch of branch folders I don't want to copy deployment to each specific folder, I want to have as a one instance) and try to find a solution for this case.

2

2 Answers

1
votes

Either apply your label at the root level, or start your build using a date or changeset number.

Another approach would be to use branching rather than labels, and set up your build to allow you to pass in the name of the branch to be built.

I no longer use labels, I can't think of a situation where they would be useful to me these days.

0
votes

If I encountered a team doing this my first question would be why do they need to use Labels to accomplish whatever workflow they are after. This is an unusual practice, most teams just do a Get Latest, and use an appropriate branching strategy to achieve their desired workflow.

If you must use a Label one option is to include the DeploymentScripts in your Labels. You can do this without have to move the folder location in source control by editing your Label.