I am writing a plugin that I would like to be able to submit artifacts. Something like `TestCollationService`, but for artifacts instead of tests. I can't seem to find anything in the documentation about how to do this.
Thanks.
Community moderators have prevented the ability to post new answers.
Well, I've gotten pretty close to being able to do this, but there is one piece missing: `theSecureToken`
taskContext.getBuildContext() .getArtifactContext() .getDefinitionContexts().add( new ArtifactDefinitionContextImpl(new ArtifactDefinitionImpl("the blah.txt", "", "blah.txt"), theSecureToken));
This block of code works perfectly.... with the one exception of the SecureToken object that I cannot find the right way to get from the agent context. The only way I have gotten this to work is by defining other artifacts, then iterating through `artifactContext.getDefinitionContexts()` to grab the SecureToken from the first one I find. However, I would like this artifact submission to work even in the case when no other artifacts are defined in the actual build plan.
I have tried auto-wiring in a SecureTokenService object (and also tried grabbing it from ContainerManager), but both result in a "no such bean definition" from Spring, which makes sense, since the token is probably generated on the server and then sent down to the agents, so that the server can verify it.
My question is, where does it exist on the agent that I can reliably grab it from?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.