Setting Artifact Paths programatically when creating a build configuration
Hi,
I'm using TeamCity Enterprise 3.1 (build 6760).
I have a server side plugin that create build configurations. One of the things it does is set the artifact path for the build. I'm using:
SBuildType win32PreRelease = bproj.createBuildType(name, "test", -1, BuildTypeDescriptor.CheckoutType.ON_AGENT);
SimpleParameter a = new SimpleParameter("artefacts.paths", "build/publish");
win32PreRelease.addRunParameter(a);
bproj.persist();
This produces in project-config.xml:
<run-parameters>
<param name="artefacts.paths" value="build/publish" />
</run-parameters>
When a build is run, artifacts are collected and stored. However, if I open the build config in the UI, I no longer see the above path in the input box.
Furthermore, if I edit and save the build config via the UI (by changing build config name), the artifacts are no longer collected.
It seems that I really need this in my project-config.xml:
<artifact-publishing paths="build/publish" />
I am not sure how I can programmatically do this.
Thanks for your help.
Scott
Please sign in to leave a comment.
Hello Scott,
Please use win32PreRelease.setArtifactPaths call to set the path.
Hope this helps,
KIR
Thanks...I was using TC jars from a previous 3.1 release. My bad!