new parameters arenot shown in pull down param list

Hi, teamcity expert,

I am writing a plugin to add new global system parameters to hold global values which will be used by the builds for applications. Follow the sample projects,

Step 1: extends class extends AbstractBuildParametersProvider and insert two new params,

@NotNull

@Override

public Map<String, String> getParameters(@NotNull final SBuild build, final boolean emulationMode) {

Map<String, String> parameters = super.getParameters(build,emulationMode);

parameters.put("system.var1", "val1");

parameters.put("system.var2", "val2");

return parameters;

}

step 2 : register this new parameter provider with ExtensionsHolder.registerExtension

step 3: add both main class and new parameterProvider class into spring.xml

step3, place the ziped plugin into the plugin folder in the teamcity and start the server

by checking the log and the plugin list in teamcity server, the plugin was successfully launched and the registration code of the new parameter provider was passed without error. However, when I pulled down the system defined parameter list, the two new parameter were not there.


Is it a right way to add new global parameters? Why are the new params not shown in the param pulldown list? What am I missing here? Thanks,

5 comments
Comment actions Permalink

interesting, I was able to see the values when I referred to the two new system params in my build. But why are the params not shown in the pulldown menu?

0
Comment actions Permalink

Hi He,

> register this new parameter provider with ExtensionsHolder.registerExtension
There is no need to register the extension, you can just define the bean in the Spring config.

The parameters appear for me in the completion just fine with the AbstractBuildParametersProvider code you noted.

0
Comment actions Permalink

teamcity.png

Thanks, Yegor. did you see the new params shown in the parameter pulldown list? how to add the new parameters into the pulldown list?

0
Comment actions Permalink

Hi He,

Yes, when I typed %var I was able to see the parameters in the drop-down.

0
Comment actions Permalink

Hi, Thanks for your information. I was able to see the new parameters under the dropdown parameter menu when I configured the individual build. However, I still cannot see the new build variables under the dropdown parameter list of project level(See below). Is AbstractBuildParametersProvider the right class to add the project-level parameters? I have tried to override both getParametersAvailableOnAgent and getParamters but it didnot work.  What is going wrong? Thanks,

tc_params.JPG

0

Please sign in to leave a comment.