qucli

command module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 16, 2017 License: MIT Imports: 4 Imported by: 0

README

dockerepos

Build Status Docker Repository on Quay GitHub release

Description

Manage repository in Quay

Table of Contents

Requirements

$ export QUAY_API_TOKEN=foobar

Installation

Using Homebrew (OS X only)

Formula is available at koudaiii/homebrew-tools.

$ brew tap koudaiii/tools
$ brew install dockerepos
Precompiled binary

Precompiled binaries for Windows, OS X, Linux are available at Releases.

From source

To install, use go get:

$ go get -d github.com/koudaiii/dockerepos
$ cd $GOPATH/src/github.com/koudaiii/dockerepos
$ make deps
$ make install
Run in a Docker container

docker image is available at quay.io/koudaiii/dockerepos.

# -t is required to colorize logs
$ docker run \
    --rm \
    -t \
    -e QUAY_API_TOKEN=foobar \
    quay.io/koudaiii/dockerepos:latest

Usage

usage: dockerepos [--version] [--help] <command> [<args>]

Available commands are:
    add-team       Add team in repository
    add-user       Add user in repository
    create         Create repository in Quay
    delete         Delete repository in Quay
    delete-team    Delete team in repository
    delete-user    Delete user in repository
    get            Get repository and Permissions in Quay
    version        Print dockerepos version and quit
create

Create repository in Quay

With --visibility option, you can public or private

$ dockerepos create quay.io/wantedly/test --visibility private
Created! quay.io/wantedly/test
get

Get repository and Permissions in Quay

$ dockerepos get quay.io/wantedly/test
Repository:
	quay.io/wantedly/test
Visibility:
	private
Permissions:
	koudaiii(admin)
add-user

Add user in repository

With --role option, you can read or write or admin

$ dockerepos add-user quay.io/wantedly/test dtan4 --role write
Added! dtan4(write) in quay.io/wantedly/test
$ dockerepos get quay.io/wantedly/test
Repository:
	quay.io/wantedly/test
Visibility:
	private
Permissions:
	koudaiii(admin)
	dtan4(write)
add-team

Add team in repository

With --role option, you can read or write or admin

$ dockerepos add-team quay.io/wantedly/test infrastructure --role write
Added! infrastructure(write) in quay.io/wantedly/test
$ dockerepos get quay.io/wantedly/test
Repository:
	quay.io/wantedly/test
Visibility:
	private
Permissions:
	koudaiii(admin)
	dtan4(write)
	infrastructure(write)
delete-user

Delete user from repository

$ dockerepos delete-user quay.io/wantedly/test dtan4
Deleted! dtan4 in quay.io/wantedly/test
$ dockerepos get quay.io/wantedly/test
Repository:
	quay.io/wantedly/test
Visibility:
	private
Permissions:
	koudaiii(admin)
	infrastructure(write)
delete-team

Delete team from repository

$ dockerepos delete-team quay.io/wantedly/test infrastructure
Deleted! infrastructure in quay.io/wantedly/test
$ dockerepos get quay.io/wantedly/test
Repository:
	quay.io/wantedly/test
Visibility:
	private
Permissions:
	koudaiii(admin)
delete

Delete repository in Quay

$ dockerepos delete quay.io/wantedly/test
Deleted! quay.io/wantedly/test
$ dockerepos get quay.io/wantedly/test
err: HTTP error!
URL: https://quay.io/api/v1/repository/wantedly/test
status code: 404
body:
{"status": 404, "error_message": "Not Found", "title": "not_found", "error_type": "not_found", "detail": "Not Found", "type": "https://quay.io/api/v1/error/not_found"}
Options
Option Description Required Default
--visibility=VISIBILITY "visibility set to 'public' or 'private' public
--role=ROLE role to use for the user or team= ['read', 'write', 'admin'] read
--help Print command line usage
-v, --version Print version

Development

Clone this repository and build using make.

$ go get -d github.com/koudaiii/dockerepos
$ cd $GOPATH/src/github.com/koudaiii/dockerepos
$ make

Contribution

  1. Fork (https://github.com/koudaiii/dockerepos/fork)
  2. Create a feature branch
  3. Commit your changes
  4. Rebase your local changes against the master branch
  5. Run test suite with the go test ./... command and confirm that it passes
  6. Run gofmt -s
  7. Create a new Pull Request

Author

koudaiii

License

MIT License

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL