locked
Control Variables in the TFS Build in Variable Tab RRS feed

  • Question

  • Hi,

    The control variables in the variable tab in the build definition, Name: Build.Clean , what would be value for Build,Clean

    Can I give the Name and leave the value empty and select the Allow at Queue Time and then when I try to queue build , can I give the value later. Please let me know.

    Thanks,


    info2m

    Wednesday, July 27, 2016 3:38 PM

Answers

  • Hi info2m,

    >> 1. "I need to understand the Label Sources on the On successful build or on every build and the label format the difference between the user defined and predefined variables and what is My.Variable? in the label source"

    For predefined variables, they are built-in variables that we don’t need to define manually in variables tab.

    For user defined variables, they are custom variables that we need to define in variables tab.

    For example:

    So, My.Variable is the sample, you could specify the name that you want. (e.g. starain.label)

    >> 2. Can I give the variable Name and leave the value empty and select the Allow at Queue Time and then when I try to do manual queue build

    Yes, we could specify the value when queue build. (Check Allow at Queue Time checkbox)

    >> 3. when can I use Build.SyncSources in the vaiable tab?

    You don’t need to use Build.SyncSources variable if you just want to disable downloading source from source control, just need to add a variable with Build.SyncSources as name and false as value in variables tab.

    Based on my test with TFS 2015 update 2.1, TFS 2015 update 3 and VSTS, TFS 2015 update 2.1 doesn’t work with specifying Build.SyncSources to false. Both TFS 2015 update 3 and VSTS are working fine.

    Regards

    Starain


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Marked as answer by info2m Friday, July 29, 2016 1:16 PM
    Friday, July 29, 2016 5:40 AM
    Moderator

All replies

  • Please explain me from the below statements in the Repository"

    $(Build.DefinitionName)_$(Build.DefinitionVersion)_$(Build.BuildId)_$(Build.BuildNumber)_$(My.Variable)
    
    Copy

    The first three variables are predefined. My.Variable is defined by you on the variables tab.

    "

    "My.Variable what are the name and value's for the variable tab"

    Team Foundation Version Control

    Repository name:  Ignore this option.

    Clean:

    • If you set it to true, the build agent cleans the repo this way:

      • undo pending changes

      • scorch

      How can I clean the repo a different way?

    • Set this to false if you want to define an incremental build to improve performance.

      Tip: In this case, if you are building Visual Studio projects, on the Build tab, you can also uncheck the Clean check box of the Visual Studio Build or MSBuild step.

    • This setting has no effect if you are using the hosted pool.

    Label sources: Select either On successful build or On every build if you want to label your source code files to enable your team to easily identify which version of each file is included in the completed build.

    In the Label format you can use user-defined and predefined variables that have a scope of "All." For example:

    $(Build.DefinitionName)_$(Build.DefinitionVersion)_$(Build.BuildId)_$(Build.BuildNumber)_$(My.Variable)
    
    Copy

    The first three variables are predefined. My.Variable is defined by you on the variables tab.

    The build process labels your sources with a TFVC label.

    Mappings:  Include with a type value of Map only the folders that your build process requires. If a subfolder of a mapped folder contains files that the build process does not require, map it with a type value of Cloak. When would I need to change TFVC mappings. How should I do it?


    info2m

    Wednesday, July 27, 2016 5:12 PM
  • Hi info2m,

    >> Please explain me from the below statements in the Repository

    Not sure what you want to know.

    >> what would be value for Build,Clean

    In Repository tab, we just could set the value to false or true. We also could set its value to all, source or binary in variables tab. Click add variable, type Build.Clean in Name, type the value in Value input box.

    For My.Variable, click add variable to add a variable too, then type variable name and value.

    Regards

    Starain


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Thursday, July 28, 2016 6:17 AM
    Moderator
  • Hi Starain,

    1. "I need to understand the Label Sources on the On successful build or on every build and the label format the difference between the user defined and predefined variables and what is My.Variable? in the label source"

    Label sources: Select either On successful build or On every build if you want to label your source code files to enable your team to easily identify which version of each file is included in the completed build.

    In the Label format you can use user-defined and predefined variables that have a scope of "All." For example:

    $(Build.DefinitionName)_$(Build.DefinitionVersion)_$(Build.BuildId)_$(Build.BuildNumber)_$(My.Variable)
    
    Copy

    The first three variables are predefined. My.Variable is defined by you on the variables tab.

    The build process labels your sources with a TFVC label.

    "

    2. Can I give the variable Name and leave the value empty and select the Allow at Queue Time and then when I try to do manual queue build , can I give the value later. Please let me know.

    3. when can I use Build.SyncSources in the vaiable tab?

    Thanks,


    info2m

    Thursday, July 28, 2016 1:00 PM
  • Hi info2m,

    >> 1. "I need to understand the Label Sources on the On successful build or on every build and the label format the difference between the user defined and predefined variables and what is My.Variable? in the label source"

    For predefined variables, they are built-in variables that we don’t need to define manually in variables tab.

    For user defined variables, they are custom variables that we need to define in variables tab.

    For example:

    So, My.Variable is the sample, you could specify the name that you want. (e.g. starain.label)

    >> 2. Can I give the variable Name and leave the value empty and select the Allow at Queue Time and then when I try to do manual queue build

    Yes, we could specify the value when queue build. (Check Allow at Queue Time checkbox)

    >> 3. when can I use Build.SyncSources in the vaiable tab?

    You don’t need to use Build.SyncSources variable if you just want to disable downloading source from source control, just need to add a variable with Build.SyncSources as name and false as value in variables tab.

    Based on my test with TFS 2015 update 2.1, TFS 2015 update 3 and VSTS, TFS 2015 update 2.1 doesn’t work with specifying Build.SyncSources to false. Both TFS 2015 update 3 and VSTS are working fine.

    Regards

    Starain


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Marked as answer by info2m Friday, July 29, 2016 1:16 PM
    Friday, July 29, 2016 5:40 AM
    Moderator
  • Thanks, Starain for your help

    info2m

    Friday, July 29, 2016 1:15 PM
  • Thanks for the details in these posts, they somewhat help as i cant find much official documentation on that.

    We are running TFS 2015 Update 3, but Build.SyncSources does not seem to work. No error, it just goes and downloads the sources.

    Is there something else we need to set to prevent the sources from beeing updated ?

    Nico

    Monday, August 21, 2017 5:07 PM