Can't use Predefined parameters in SSH upload

Hi, I've been trying to get predefined parameters to work when using SSH Upload Build Step. I want to get the latest build from artifacts (.../internalbuildID/stuff) and for my list of files to upload, I had something along the lines of:

path/to/file/%teamcity.project.id%/pls

And as far as I'm aware, project ID is the internal file ID, which is how artifacts are stored. However, I using this parameter in my builds always causes the upload to (silently) fail, saying it's uploaded 0 files. However, when I hardcode the value, it works, so I know the actual path is correct.

 

Is there any way to get this working? Thanks!

0
1 comment
Official comment

Hello,

(Assuming you are using a recent version of TeamCity)

Parameter references should work for any step type.

First, you can check if the parameter actually work and to what value it resolves to. Adding command line build step with echo "path/to/file/%teamcity.project.id%/pls" might be useful here.

Let me note that allowing agent to access server's TeamCity Data Directory is highly not recommended. If you want to use artifact produced by one build in anoher, use artifact dependency: https://confluence.jetbrains.com/display/TCD10/Dependent+Build#DependentBuild-ArtifactDependency

Please sign in to leave a comment.