dockerepos
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
list List repository and Permissions in Quay
version Print dockerepos version and quit
list
List repository in namespace
With --is-public
option, you can true
or false
$ dockerepos list koudaiii
NAME isPublic DESCRIPTION
quay.io/koudaiii/apig-sample true
quay.io/koudaiii/dockerepos true
quay.io/koudaiii/kubeps true
quay.io/koudaiii/test true
get
Get repository and Permissions in Quay
$ dockerepos get quay.io/wantedly/test
Repository:
quay.io/wantedly/test
Visibility:
private
Permissions:
koudaiii(admin)
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
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"}
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)
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 |
--is-public=bool |
repository type is public. true or false |
|
true |
--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
- Fork (https://github.com/koudaiii/dockerepos/fork)
- Create a feature branch
- Commit your changes
- Rebase your local changes against the master branch
- Run test suite with the
go test ./...
command and confirm that it passes
- Run
gofmt -s
- Create a new Pull Request
Author
koudaiii
License