Skip to content
/ n3dr Public
forked from 030/n3dr

Nexus3 backup and migration tool

License

Notifications You must be signed in to change notification settings

kranthie/n3dr

 
 

Repository files navigation

n3dr

GoDoc Widget Build Status Go Report Card DevOps SE Questions Docker Pulls Issues Pull requests Total downloads License Repository Size Contributors Commit activity Last commit Release date Latest Production Release Version Bugs Code Smells Coverage Duplicated Lines (%) Lines of Code Maintainability Rating Quality Gate Status Reliability Rating Security Rating Technical Debt Vulnerabilities CII Best Practices codecov BCH compliance

The aims of the n3dr tool are:

  • to backup all artifacts from a certain Nexus maven repository.
  • to migrate all artifacts from NexusA to NexusB.

How do the tests look like?

The tests start a nexus docker container. The tests will be started once the docker container is running and fake artifacts have been uploaded. Finally, all submitted artifacts will be downloaded.

How to use this tool?

Docker-compose

One could use this docker-compose.yml and start a backup of all repositories, after modifying it, and issue:

docker-compose up

Password

Define the password in ~/.n3dr.yaml:

---
n3drPass: admin123

and set the permissions to 400 by issuing:

chmod 400 ~/.n3dr.yaml

Help

In order to read the help menu, one has to run:

./n3dr

The output will look as follows:

N3DR is a tool that is able to download all artifacts from
a certain Nexus3 repository.

Usage:
  n3dr [command]

Available Commands:
  backup       Backup all artifacts from a Nexus3 repository
  help         Help about any command
  repositories Count the number of repositories or return their names

Flags:
  -h, --help   help for n3dr

Use "n3dr [command] --help" for more information about a command.

Backup

The backup command will backup all artifacts that reside in a Nexus maven repository.

[user@localhost n3dr]$ ./n3dr backup -h
Use this command in order to backup all artifacts that
reside in a certain Nexus3 repository

Usage:
  n3dr backup [flags]

Flags:
  -h, --help              help for backup
  -p, --n3drPass string   The Nexus3 password (default "admin123")
  -r, --n3drRepo string   The Nexus3 repository (default "maven-releases")
  -n, --n3drURL string    The Nexus3 URL (default "http://localhost:8081")
  -u, --n3drUser string   The Nexus3 user (default "admin")

Repositories

In order to get an overview of all repositories that are available in a certain Nexus3 instance, one could use the following commands:

Count the number of repositories or
count the total

Usage:
  n3dr repositories [flags]

Flags:
  -c, --count   Count the number of repositories
  -h, --help    help for repositories
  -n, --names   Print all repository names

Download artifacts from all repositories

go run main.go repositories --download --n3drURL http://localhost:9999

dockeri.co

docker run --rm -e HTTPS_PROXY=some-proxy \
           -v ~/.n3dr.yaml:/home/n3dr/.n3dr.yaml \
           -v ${PWD}/nexus3backup:/download utrecht/n3dr:3.0.0 \
           backup -p pass -r maven-releases \
           -n https://some-nexus-repo -u admin

Difference with equivalent tools

There is a number of equivalent tools:

The difference is that n3dr is able to download artifacts from all Nexus3 repositories.

About

Nexus3 backup and migration tool

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 94.6%
  • Shell 3.9%
  • Dockerfile 1.5%