coolSever
coolSever

Reputation: 46

Teamcity Dependencies Password Variable

Can't pass password to the child build in Teamcity.

In the Teamcity project, there is a build that works fine. A password is requested and system login is used.

LOGIN       %teamcity.build.triggeredBy.username%
PASSWORD    %secure:teamcity.password.PASSWORD%

I create another build and I specify the first build as the child. Teamcity runs a child build with default parameters.

  1. To send parameters to the child build, I create the following parameters in the parent:

    reverse.dev.Buil_ID.PARAMETER

With all the usual parameters, this works fine, but the password is not transmitted. If the type of the password field is changed to Text - the password starts to be transmitted, but appears in the logs and parameters in the clear.

  1. The variable PASSWORD as %secure:teamcity.password.PASSWORD% is moved to the project level. In the parent build, it is queried and works fine, the variable is not defined in the child build.

  2. Define the password as %teamcity.auth.password% In this case, the hash password is passed. How to return it to its original form from hash?

Maybe there are other solutions to the problem?

Upvotes: 2

Views: 3138

Answers (1)

jimmbraddock
jimmbraddock

Reputation: 887

It's security restrict of Teamcity. There is two refers in the documentation about password type fields.

When using build parameters of type "Password", referencing them from a dependency such as %dep..password_parameter% will not retrieve the actual value. This is done for security reasons to prevent dependencies from accessing the value, thus restricting the possibility of unauthorized access to it.

Properties marked by the VCS support as secure (for example, passwords) are not available as reference properties.

Accordinly, reverse.dep. also won't work.

Upvotes: 2

Related Questions