%env.Configuration% gives warning-No enabled compatible agents for this build configuration

Answered

In order to set up automated deployment to my Test Server, I am trying to follow this example -

https://www.troyhunt.com/you-deploying-it-wrong-teamcity_26/

In this example I can see in general settings, for Artifact Paths, the following path is given -

Web\obj\%env.Configuration%\Package

and also in in build step (for "MS Build"), within command line parameters, it is used like

/P:Configuration=%env.Configuration%

Whenever I put “%env.Configuration%”, I get a warning on run - Warning: No enabled compatible agents for this build configuration. Please register a build agent or tweak build configuration requirements.

I already set up team city to pull code from my GitHub and Run it successfully whenever a new commit is made to GitHub. It is working fine. But, I can't do automated deployment due to this warning.

Do I need to add anything in the default agent which was created by Team City? I don't understand what I am missing.

Thanks a lot for your help

 

0
4 comments

Hello Robinspaul,

By specifying "%env.Configuration% you create a new parameter for a build configuration. After that, you should set up a value for a parameter. You can do it on Parameters tab on Edit Configuration Settings page. 

After specifying the parameter, you can run your build configuration on an agent. You could also run a build configuration with custom value for a parameter by clicking on Run custom build (it's described in "Passing parameters to the build and deploying to other environments" section in the mentioned article). 

0
Avatar
Permanently deleted user

Hi,

Thanks for your reply.


I looked in Environment Variables section under Agent Parameters tab. I can't see any Add New button there.

Where do I create the new variable?

What should be variable name and what should I assign to it?


Could you please give me an example?


Thank a lot for your help,

0

Hi,

Environment Variables section under Agent Parameters tab is not what we are looking for. 

Please, use the following steps:

  • Open a build configuration
  • Click on "Edit configuration settings" link in the right upper corner
  • Open "Parameters" tab
  • Here you should see undefined parameters for your build configuration (e.g. %env.Configuration%).

You do not need to modify parameters names. What value should be assigned for the parameter depending on your MSBuild script. Looks like it can be something like "Deploy-Dev" (if you've gone through all part of this tutorial it should work). It was particularly mentioned in this part.

0
Avatar
Permanently deleted user

Hi Nadia,

Thank you so much for explaining it to me.

I can see where I need to add the value for env.Configuration

I am using GitHub as my source control and hosting the website on Azure.

At the moment I am using FileZilla to deploy using FTP.

I am not sure what value I need to add env.Configuration for an Azure website.

I am still googling. Any clue will be very helpful.

Thanks a lot,

 

0

Please sign in to leave a comment.