This is mostly a collection of Groovy scripts to automate things on Sonatype Nexus 3.x.
content_selector.groovy
: API script for managing content_selectorsprivilege.groovy
: API script for creating or deleting privilegesrepo_docker_hosted.groovy
: API script for hosted docker repositoriesrepo_docker_group.groovy
: API script for docker group repositoriesrepo_raw_hosted.groovy
: API script for raw docker repositoriesrole.groovy
: API script for roles managementuser.groovy
: API script for user management
You have to pass parameters to these API scripts. A description of these parameters can be found in the header of each file.
curl -X POST \
http://localhost:8081/service/rest/v1/script/repo_docker_hosted/run \
-u admin:admin \
-H 'Content-Type: application/json' \
-d '{
"action": "create",
"port": 5050,
"id": "repo_name"
}'
It is necessary to upload the api_scripts
to Nexus. There are some scripts, located within the helper
directory, which might be helpful to master this task:
create_all
: Upload all API scripts to Nexus.create.sh
: Upload a single API script to Nexus.delete.sh
: Delete a single API script from nexus.list.sh
: List all API scriptsrun.sh
: Run a API script on Nexus (mostly useless because it does not pass any parameters)settings.conf
: Account settings
Upload all files to the Nexus server:
cd helper
vi settings.conf
./create.all.sh
The directory tests
contains a all.sh
scripts which can be used throw test against a local Nexus installation.