20 lines
574 B
Groovy
20 lines
574 B
Groovy
#!/usr/bin/env groovy
|
|
|
|
import groovyx.net.http.URIBuilder
|
|
|
|
Map call(Map config = [:]) {
|
|
Map defaults = [
|
|
nexusBase: 'https://repo.thejimnicholson.com',
|
|
searchAPI: 'service/rest/v1/search',
|
|
repositoryName: 'tools'
|
|
]
|
|
Map runConfig = defaults + config
|
|
|
|
nexusSearch = new URIBuilder(runConfig.nexusBase)
|
|
/* groovylint-disable-next-line UnnecessarySetter */
|
|
nexusSearch.setPath(runConfig.searchAPI)
|
|
nexusSearch.addQueryParam('repository', runConfig.repositoryName)
|
|
runConfig.nexusQuery = nexusSearch
|
|
return runConfig
|
|
}
|