0

I am configuring VSTS build and release process.

I have a scenario where I have DEV and QA environments. I have different config files for each of the environments, think of the naming convention Test.Dev.Config Test.QA.Config

In the "Copy files to" step of the build process, in the "contents" field, are you able to use the BuildConfiguration variable in order to tell the build process to copy the configuration files relevant to the BuildConfiguration:

enter image description here

so that the output of the package contains the Test.DEV.config files for the Dev build step and the Test.QA.config file for the QA build step.

I am basically testing out a options for config transforms in VSTS

Darren
  • 93
  • 7
  • The variable value should be applied, is _PublishedWebSites folder under source directory ($(Build.SourcesDirectory), e.g. D:\1\s\_PublishedWebSites), can you share the detail log on the OneDrive? (Set system.debug to true, then queue build and share this log) – starian chen-MSFT Nov 20 '17 at 06:12

1 Answers1

0

Using a VSO variable combined with a string literal often doesn't work as expected within a task like File Copy. Also, you don't want to do that in every task that requires build configuration specific config file. What you can do instead, is to have a separate variable in your build definition that derives from BuildConfiguration variable like so:

Variable              Value
BuildConfigFile    *.$(BuildConfiguration).config

And then, within the File Copy task, you can directly use this variable as:

_PublishedWebsites\App_Config\$(BuildConfigFile)

For more details on defining one variable in terms of the other, refer this SO post.

ThePretendProgrammer
  • 1,449
  • 10
  • 16