Skip to content

Instantly share code, notes, and snippets.

@jki21
jki21 / rawPopulator.groovy
Last active March 3, 2023 08:43 — forked from ThiboKay/rawPopulator.groovy
Uploads all files in a given directory to a Raw hosted Repository on Nexus 3. Revise to use URL instead of HTTPBuilder.
import groovy.cli.commons.CliBuilder
import static groovy.io.FileType.FILES
CliBuilder cli = new CliBuilder(
usage: 'groovy clientDemo.groovy -u {user} -p {password} -d {path to content} -n {repoName} [-h {nx3Url}]')
cli.with {
u longOpt: 'username', args: 1, required: true, 'A User with permissions to push to the target repo'
p longOpt: 'password', args: 1, required: true, 'Password for given User'
n longOpt: 'repoName', args: 1, required: true, 'Name of repo to publish to'
d longOpt: 'dir', args: 1, required: true, 'Path of directory to recursively publish'