How to access maven-build-info.xml.gz during build configuration execution

After a maven-steps uploads some snapshot artifacts to artifactory, I need to import them into UCD. For this I need the version number of the uploaded artifact. I can find the version number after the build in hidden artifacts in the relevant maven-build-info.xml.gz file and have a python script to properly extract it. But how do I access this information when the build is still running? The .teamcity folder is nowhere to be found ...

0
2 comments

Hi,

 

how is this "build number" generated? Isn't it TeamCity's build number? If so you can simply reference the %build.number% parameter to obtain it directly. If it's not, it has to be generated somehow, and if it's by the artifactory plugin, you might want to ask artifactory about that, but as far as I am aware, this will be the build number, or the build counter (which has the same relevant %build.counter% parameter)

 

More info on build parameters here: https://www.jetbrains.com/help/teamcity/configuring-build-parameters.html

0
Avatar
Permanently deleted user

I have the exact same number as the OP.

Yes the timestamp is generated somewhere in the teamcity-maven-artifactory plugin chain, but since this is all managed by teamcity it is no simple matter to dissect it and extract this information from somewhere in the middle, and doesn't seem to me like the most sensible architecture either.

Teamcity has this info and writes it successfully to the maven-build-info.xml file.

If I download this file from the gui I can easily get the timestamp like this:
xmllint --xpath //projects/project/artifact/version maven-build-info.xml | awk -F '>' '{ print $2 }' | awk -F '<' '{ print $1 }'
 

So to automate this in a further build step all I need is the file.

The build log has the following lines:

[09:12:34][Publishing artifacts] Collecting files to publish: [/home/tcagent/buildAgent/temp/buildTmp/.tc-maven-bi/maven-build-info.xml.gz => .teamcity]
[09:12:34][Publishing artifacts] Publishing 1 file using [ArtifactsCachePublisher]: /home/tcagent/buildAgent/temp/buildTmp/.tc-maven-bi/maven-build-info.xml.gz => .teamcity
[09:12:34][Publishing artifacts] Publishing 1 file using [WebPublisher]: /home/tcagent/buildAgent/temp/buildTmp/.tc-maven-bi/maven-build-info.xml.gz => .teamcity
 
so not sure what that means exactly? Is ".teamcity" a link created somewhere and if so where can I access it?
Or can I directly access:
/home/tcagent/buildAgent/temp/buildTmp/.tc-maven-bi/maven-build-info.xml.gz
?
 
Many thanks!
0

Please sign in to leave a comment.