Git Product home page Git Product logo

nexus-2-repository-cli's Introduction

nexus-2-repository-cli is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

nexus-2-repository-cli is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with nexus-2-repository-cli. If not, see http://www.gnu.org/licenses/.

nexus-2-repository-cli

A CLI tool for managing Nexus 2 Repositories.

Only works with Nexus Repository Version 2.x

Context

This contains a library that can interact with Nexus Repository. It is written in Go. See the documentation of the 'action' parameter for a list of possible operations that can be performed.

Usage

Documentation from the commandline tool (cli):

Usage of ./nexus-repository-cli:
  -action string
	- find: find a repository. Optional arguments: 'type', 'format', 'filter', 'separator', 'linkedRepositoryFilter'
	- add: add repository/repositories to a groupRepository. Required: target, sourceRepo. (optional: separator, if more than one repo is listed in sourceRepo)
	- create: create new repository. Required arguments: username, password, type, provider, target (optional: remote, if repoType is 'proxy')
	- delete: delete a repository. Required arguments: username, password, type, target
	 (default "find")
  -filter string
    	Optional: regex filter for the names of repositories (default "(.*)")
  -format string
    	The repository format, such as maven2, npm, nuget, etc.
  -linkedRepositoryFilter string
    	Filter for linked repositories (Not a regex) (optional)
  -nexusUrl string
    	Nexus host name (full base url), e.g. http://localhost:8081/nexus
  -notLinked
    	Set this flag if you do NOT want repos that link with 'linkedRepositoryFilter'
  -password string
    	Nexus username's password (required) (default "admin123")
  -policy string
    	snapshot or release (default "snapshot")
  -provider string
    	The repository provider, such as maven2, npm, nuget, etc.
  -remote string
    	Remote URL for the target if the create's repoType is proxy
  -separator string
    	Separator for list of outputs or for inputs (sourceRepo) (default "\n")
  -sourceRepo string
    	Repository to add the target, if more than one, use separator flag for specifying the separator for splitting the values
  -target string
    	Group repository to add the repositories to; in case of create: name of the repository to create
  -type string
    	Optional. Values: hosted, proxy, virtual, group (default "hosted")
  -username string
    	Nexus username (required)(default "admin")
  -verbose
    	Set the flag if you want verbose output

Examples

./nexus-repository-cli -action create -type proxy -target random-proxy -provider maven2 -remote https://repo.jenkins-ci.org/releases/ -policy release
Success: new resource created
./nexus-repository-cli -action create -type group -target random-group -provider maven2
Success: new resource created
./nexus-repository-cli -action create -type hosted -target random-release -provider maven2 -policy release
Success: new resource created
./nexus-repository-cli -action add -target random-group -sourceRepo random-release,random-proxy -separator ,
Success: linked repositories 
./nexus-repository-cli -action find -separator ,  -filter "([a-zA-Z]*)"
random-release,releases,snapshots,thirdparty
./nexus-repository-cli -action find -separator , -type group  -linkedRepositoryFilter random-proxy         
random-group

Building

To build the project yourself, do the following in the project root-folder

# bash-only
export GOPATH=`pwd`
go build com/abnamro/solo/nexus-repository-cli

nexus-2-repository-cli's People

Contributors

joostvdg avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  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.