TeamCity parameter specification referring to another parameter? - teamcity

I am using the latest version of TeamCity and I am trying to make a parameter specification that refers to parameters.
I tried making a select (combobox), where the options of the checkbox are referring to variables. This should be possible, as there is a "parameter" icon to the right of the box suggesting me that I can use parameters here.
The full setup is shown below.
However, when I want to run the build, the only options are literally %foo% and %bar% as if the parameters have not even been evaluated.
Instead I had expected the options to contain the values of the variables that they are pointing to.
What am I doing wrong here?

Might be a bit late, but this is how I did it:
I have a few parameters for holding passwords, e.g. 'mfgpwd'
And I refer to these in another parameter using the syntax:
mfgpwd=%system.mfgpwd%
(I'm using TeamCity 8.1.5)

Related

Is there a way to force a default value for a parameter in TeamCity and not lose it once a different value has been set?

I have a parameter for which I'm showing a prompt. I've set a default value for it and that works fine.
What doesn't work, however, is that if I choose to enter a different value when running the build, then on the next build this value automatically becomes the new default value, so to say.
I'd like the default value to always be fixed and if you enter a different value in the field, then that value will be used just for this build (and the next build will fallback to the fixed, default value for this parameter).
Is this possible and how can it be done?
Currently it's not possible. The related request is https://youtrack.jetbrains.com/issue/TW-21453, please vote. As of now you can use "Reset" link.
As far as I know, there's no built-in solution for this.
To solve your problem, you could use a Command Line (or Powershell) Build Runner that runs as the last step of the build. There you can reset your parameter by setting it to the desired default value using this as script content:
##teamcity[setParameter name='your.parameter' value='desiredDefaultValue']
I would recommend using a separate parameter to save desiredDefaultValue instead of a hard-coded value.

Find Variable Declaration in Mathcad

Is there a way to quickly find where a variable was initially defined/declared in Mathcad.
I'm working in a rather large Mathcad (150 pages get printed). I'll see an equation that is using variables declared in earlier sections however I can't use the Edit->Find since the variable uses subscripting. I resort to eye scanning for the variable declaration.
In Eclipse you can control click on a variable and it will take you to the variables declaration. Is there something similar in Mathcad?
Unfortunately, there isn't a 'search for definition' feature. I believe that there have been a number of requests for it over the years ...
Why can't you Edit/Find, though? Which kind of subscripting are you referring to: index or name? Which version of Mathcad are you using?
Search for an array name shouldn't be a problem, as the index won't form part of the name.
If you want a subscripted name and you are using Mathcad 15 (or lower), then simply type the name as you would enter it; eg if your variable is xsub then type x.sub in the find box.

How to control variable substitution in JMeter?

I have some user defined variables:
SERVER_NAME myhost.com
THE_HTTP_PROTOCOL HTTP
LOOP_COUNT 2
Then, I use a Recording Controller to capture my browser actions. Unfortunately, JMeter does more variable substitution than I'd like it to. For example, it substitutes ${LOOP_COUNT} into a web site name that contains "2", e.g., /host${LOOP_COUNT}/somePage. My favorite example of over-zealous variable substitution is my ${THE_${THE_HTTP_PROTOCOL}_PROTOCOL} Header Manager.
Is it possible to make the recording more selective about what variables can be used for substitution? For example, of the variables I've listed, I'd really only like SERVER_NAME to be substituted in.
I'm using JMeter 2.11.
For now you must disable User Defined Properties during recording.
Maybe you could open a bugzilla request here:
http://jmeter.apache.org/issues.html
Note that variable substitution works better with Regex Matching checked (HTTP(S) Test Script Recorder component) as it will be much more intelligent.
But ensure if you use it you do not use values (usually short ones) that can be frequently in responses/requests.
I wouldn't recommend to substitute variables during recording as the behavior may be flaky.
If you want to parametrize your recorded test it's better to go for
HTTP Request Defaults - for host, protocol and any other http-related stuff
JMeter Properties and functions like _P() or _property() to retrieve them .
Actually I would set host and protocol as properties too as they can be set via command line, via Ant or Maven plugin or any other way of invoking JMeter. Besides properties can be shared across thread groups and variables have local scope.
I was able to work around the problem by adding a User Defined Variables (UDV) element to my workbench.
It defined:
THE_HTTP_PROTOCOL someStringThatShouldNeverBeMatched
USER_COUNT someStringThatShouldNeverBeMatched
Then, when I recorded, I did not get the unwanted variable substitutions.
Another option is to break up a monolithic collection of variables into smaller groups using User Defined Variables. Then, you can disable certain of those smaller groupings when you need to record. For example, you could put USER_COUNT into a "Flow of Control" UDV, and then disable it at recording time as shown below.

What else can be learned from the Installer.ProductInfo property?

Installer.ProductInfo is this.
I take this script, and I want to get various information (ex: UpgradeCode), where I can see all parameters, witch I cat set instead of "Version" (here installer.ProductInfo(product, "Version")). Yes, I see For Each property In Array..., but it is not enough for me (where "UpgreadeCode"?)). And where did this Array?
For a full list of supported properties check the description of the szProperty parameter of the MsiGetProductInfo function.
Most properties in this article are specified using predefined constants (e.g. INSTALLPROPERTY_HELPLINK instead of "HelpLink"); the actual string names of these properties are defined in the msi.h header file that is part of Windows SDK. A copy of msi.h v.4.0 can also be found online here.

Using Apache and mod_ext_filter, need to dynamically replace values of static file based off of query string

I've got a situation where I need to alter the contents of a cached file based off of one of the query string arguments passed in. I'd love to use sed to do a simple regular expression replacement of a value based off of said argument but I can't figure that one out. I could use a ruby script to do the replacement for me but can't seem to access the query string for the request within the script. The documents for mod_ext_filter say:
In addition to the standard CGI environment variables, DOCUMENT_URI, DOCUMENT_PATH_INFO, and QUERY_STRING_UNESCAPED will also be set for the program.
Um yeah, can't seem to access those.
Has anybody any experience with this or does anybody have a better solution?
Doh! Looks like I simply need to access the ENV variable within ruby. Pretty dumb of me.
Using PHP scripting language server function we can able to get the query string values.
echo $_SERVER['REQUEST_URI'];
And pass the URL arguments as a variable to the file and make it dynamic.
Refer : PHP.net

Resources