-
Notifications
You must be signed in to change notification settings - Fork 50
Programmatically creating a repo via the script API #66
Comments
Can we put something in the json that does something similar to the groovy script "internal/provisioning/RepositoryApiImpl.groovy"? So emulate a "createAptHosted" in the json we upload using "RepositoryApiImpl.groovy" as a reference. The "content" section of the json is in groovy. "RepositoryApiImpl.groovy" seems to provide the groovy implementations of the create functions for the other repo types. |
I think these convenience methods are only for built-in repository types, so I wouldn't expect there to be a createAptHosted method. Think you'd have to implement the logic yourself in your script. |
For others that are attempting this here's what worked for me: Grab provision.sh and addUpdateScript.groovy from the below repository: https://github.com/sonatype/nexus-book-examples/tree/book-examples-3.2/scripting/complex-script ( note I had to add Create a groovy script for adding apt-repo
|
@Alan01252 , |
HI, @hmkhitaryan Did you have any luck? I'm not entirely sure I understand what you're asking but happy to help if I can. |
Dear @Alan01252 , the thing is so, I can create, delete repositories programatically, but every time I send "http://localhost:8081/service/rest/v1/script/{name}" request, I have to send this request then |
Hi!
We're trying to create an APT repo via curl (ultimately from jenkins). In https://github.com/sonatype/nexus-public/blob/master/plugins/nexus-script-plugin/src/main/java/org/sonatype/nexus/script/plugin/RepositoryApi.java we can see a number of built-in methods for creating different types of repos. Does the APT plugin add a new method for this? We tried the following:
The error suggests some alternatives but "createAptHosted" is not among them, which makes me think that this is a dead end. Or are we missing something?
We're using Nexus Repository Manager OSS 3.11.0-01 and nexus-repository-apt 1.0.7.
Thank you,
The text was updated successfully, but these errors were encountered: