Coder Social home page Coder Social logo

n3dr's Introduction

n3dr

GoDoc Widget Build Status Go Report Card StackOverflow SE Questions DevOps SE Questions ServerFault SE Questions Issues Pull requests Total downloads GitHub forks GitHub watchers GitHub stars 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 GolangCI

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.

Installation

curl -L https://github.com/030/n3dr/releases/download/z.y.z/n3dr-linux -o n3dr-linux
curl -L https://github.com/030/n3dr/releases/download/z.y.z/n3dr-linux.sha512.txt -o n3dr-linux.sha512.txt
sha512sum --check n3dr-linux.sha512.txt
chmod +x n3dr-linux
./n3dr-linux

Debian

VERSION=z.y.z && \
curl -L https://github.com/030/n3dr/releases/download/${VERSION}/n3dr_${VERSION}-0.deb -o n3dr.deb && \
sudo apt -y install ./n3dr.deb

Check the help menu

user@computer:~/dev$ ./n3dr-linux -h
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
  upload       Upload all artifacts to a specific Nexus3 repository

Flags:
  -v, --apiVersion string   The Nexus3 APIVersion, e.g. v1 or beta (default "v1")
  -d, --debug               Enable debug logging
  -h, --help                help for n3dr
      --insecureSkipVerify  Skip repository certificate check
  -p, --n3drPass string     The Nexus3 password
  -n, --n3drURL string      The Nexus3 URL
  -u, --n3drUser string     The Nexus3 user
  -z, --zip                 Add downloaded artifacts to a ZIP archive

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

Store the password in a read-only file

Define the password in ~/.n3dr.yaml:

---
n3drPass: admin123

and set the permissions to 400 by issuing:

chmod 400 ~/.n3dr.yaml

Backup artifacts from a certain repository

All artifacts from a repository will be stored in a download folder when the following command is run:

./n3dr-linux backup -u admin -n http://localhost:8081 -r maven-releases

Backup all repositories

All artifacts from various repositories will be stored in a download folder when the following command is issued:

./n3dr-linux repositories -u admin -n http://localhost:8081 -b

Note: a new folder will be created for every repository:

  • download/maven-public
  • download/maven-releases

Backup only certain artifacts

It is possible to only download artifacts that match a regular expression. If one would like to download all artifacts from 'some/group42' then one could do that as follows:

./n3dr-linux backup -u admin -n http://localhost:8081 -r maven-releases -x 'some/group42'

If one would like to deploy is while download from all repositories then use the -x option as well:

./n3dr-linux repositories -u admin -n http://localhost:8081 -b -x 'some/group42'

Add all downloaded archives to a ZIP archive

In order to add all archives to a zip archive, one has to use the --zip or -z flag.

Upload all artifacts to a certain repository

It is possible to upload all JARs that reside in a folder by running the following command:

./n3dr-linux upload -u admin -n http://localhost:8081 -r maven-public

"Clone" a Nexus3 repository

Suppose that one has created a new Nexus3 repository, e.g. NexusNEW and that one would like to copy the content of the old repository, e.g. NexusOLD, then these basic steps could be issued to "clone" NexusOLD:

n3dr backup -u <old-nexus3-user> -n <old-nexus3-server-url> \
-r <old-repo-source-name>
cd download
mv <old-repo-source-name> <new-repo-target-name>
n3dr upload -u <new-target-nexus3-user> -n <new-target-nexus3-server-url> \
-r <new-repo-target-name>

Rationale for N3DR

Although there is a number of equivalent tools:

None of them seems to be able to backup all repositories by running a single command.

Stargazers over time

Stargazers over time

n3dr's People

Contributors

030 avatar titou10titou10 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.