COPR-CLI(1) | COPR | COPR-CLI(1) |
NAME
copr-cli - command line interface for the Copr service
SYNOPSIS
copr-cli [-h] [--version] [--config CONFIG] {list,create,build} ...
DESCRIPTION
This command allows you to interact with the Copr service from the command line.
You need to to configure authentication first (see the AUTHENTICATION section below).
OPTIONS
-h, --help
--version
--config
ACTION LIST
list [username|@groupname]
create
delete
build
status
cancel
download-build
modify
regenerate-repos
add-package-*
edit-package-*
list-packages
list-package-names
get-package
delete-package
reset-package
build-package
mock-config
build-module
PROJECT ACTIONS
copr-cli create [options]
usage: copr-cli create [-h] --chroot CHROOTS [--repo REPOS] [--initial-pkgs PKGS] [--description DESCRIPTION] [--instructions INSTRUCTIONS] [--disable_createrepo DISABLE_CREATEREPO] [--enable-net {on,off}] [--unlisted-on-hp {on,off}] [--persistent] [--auto-prune {on,off}] [--isolation {default, nspawn, simple}] name
--chroot
--repo
--initial-pkgs
--description
--instructions
--disable_createrepo
--enable-net
--unlisted-on-hp
--persistent
--auto-prune
--isolation ISOLATION
name
copr-cli modify [options]
usage: copr-cli modify [-h] [--repo REPOS] [--chroot CHROOTS] [--description DESCRIPTION] [--instructions INSTRUCTIONS] [--disable_createrepo DISABLE_CREATEREPO] [--enable-net {on,off}] [--unlisted-on-hp {on,off}] [--auto-prune {on,off}] [--isolation {default, nspawn, simple}] name
Alters only specified project property.
--repo
--chroot
--description
--instructions
--disable_createrepo
--enable-net
--unlisted-on-hp
--auto-prune
--isolation ISOLATION
name
copr-cli regenerate-repos [options]
usage: copr-cli regenerate-repos [-h] copr
copr
BUILD ACTIONS
copr-cli build [options]
usage: copr-cli build [-h] [-r, --chroot CHROOTS] [--memory MEMORY] [--timeout TIMEOUT] [--nowait] [--background] [--isolation {default, nspawn, simple}] [--enable-net {on,off}] copr_repo PKG [PKG ...]
-r, --chroot
--exclude-chroot
--memory
--timeout
--nowait
--background
--isolation ISOLATION
--enable-net
copr_repo
PKG
copr-cli buildpypi [options]
usage: copr buildpypi [-h] [-r, --chroot CHROOTS] [--memory MEMORY] [--timeout TIMEOUT] [--nowait] [--background] [--pythonversions [VERSION [VERSION ...]]] [--packageversion PYPIVERSION] --packagename PYPINAME project
--pythonversions [VERSION [VERSION ...]]
--packageversion PYPIVERSION
--packagename PYPINAME
For the rest of the arguments, see copr-cli build command above.
copr-cli buildscm [options]
usage: copr buildscm [-h] --clone-url CLONE_URL [--commit COMMITTISH] [--subdir SUBDIRECTORY] [--spec SPEC] [--type {git,svn}] [--method {rpkg,tito,tito_test,make_srpm}] [--memory MEMORY] [--timeout TIMEOUT] [--nowait] [-r CHROOTS] [--background] copr_repo
Build package from a Git/DistGit/SVN repository.
--clone-url CLONE_URL
--commit COMMITISH
--subdir SUBDIRECTORY
--spec SPEC
--type TYPE
--method METHOD
For the rest of the arguments, see copr-cli build command above.
copr-cli download-build [options]
usage: copr-cli download-build [-h] [-d, --dest DESTINATION] [-r, --chroot CHROOT] build_id
build_id
-d, --dest
-r, --chroot
copr-cli delete-build [options]
usage: copr delete-build [-h] build_id [build_id ...]
build_id
EXAMPLES
copr-cli build myproject some.src.rpm copr-cli build someone_else/project some.src.rpm copr-cli build -r fedora-24-x86_64 -r fedora-24-i386 "@somegroup/project" some.src.rpm
CHROOT ACTIONS
copr-cli edit-chroot [options] coprchroot
usage: copr edit-chroot [-h] [--upload-comps FILEPATH | --delete-comps] [--packages PACKAGES] [--repos REPOS] [--isolation {default, nspawn, simple}] coprchroot
Edit the specified coprchroot.
coprchroot
--upload-comps FILEPATH
--delete-comps
--packages PACKAGES
--repos REPOS
--isolation ISOLATION
copr-cli get-chroot coprchroot
usage: copr get-chroot [-h] coprchroot [--output-format {json, text, text-row}]
Print info of the given chroot.
coprchroot
--output-format FORMAT
PACKAGE ACTIONS
copr-cli add-package-pypi [options]
usage: copr add-package-pypi [-h] [--pythonversions [VERSION [VERSION ...]]] [--packageversion PYPIVERSION] --packagename PYPINAME --name PKGNAME [--webhook-rebuild {on,off}] project
Add package of PyPI source type.
--pythonversions [VERSION [VERSION ...]]
--packageversion PYPIVERSION
--packagename PYPINAME
--name PKGNAME
--webhook-rebuild {on,off}
copr-cli edit-package-pypi [options]
usage: copr edit-package-pypi [-h] [--pythonversions [VERSION [VERSION ...]]] [--packageversion PYPIVERSION] --packagename PYPINAME --name PKGNAME [--webhook-rebuild {on,off}] project
Edit source definition and type of an existing package. Options are shared with add-package-pypi.
copr-cli add-package-scm [options]
usage: copr add-package-scm [-h] --clone-url CLONE_URL [--commit COMMITTISH] [--subdir SUBDIRECTORY] [--spec SPEC] [--type {git,svn}] [--method {rpkg,tito,tito_test,make_srpm}] --name PKGNAME [--webhook-rebuild {on,off}] copr Add package of SCM source type. --clone-url CLONE_URL:: clone url to a project versioned by Git or SVN, required --commit COMMITISH:: branch name, tag name, or git hash to be built --subdir SUBDIRECTORY:: relative path from the repo root to the package content --spec SPEC:: relative path from the subdirectory to the .spec file --type TYPE:: Specify versioning tool. Default is 'git'. --method METHOD:: Srpm build method. Default is 'rpkg'. --name PKGNAME:: Name of the package to be edited or created --webhook-rebuild {on,off}:: Enable auto-rebuilding `copr-cli edit-package-scm [options]`
usage: copr edit-package-scm [-h] --clone-url CLONE_URL [--commit COMMITTISH] [--subdir SUBDIRECTORY] [--spec SPEC] [--type {git,svn}] [--method {rpkg,tito,tito_test,make_srpm}] --name PKGNAME [--webhook-rebuild {on,off}] copr
Edit package of SCM source type.
copr-cli add-package-rubygems [options]
usage: copr add-package-rubygems [-h] [--gem GEM] --name PKGNAME [--webhook-rebuild {on,off}] project
Add package of RubyGems source type.
--gem GEM
--name PKGNAME
--webhook-rebuild {on,off}
copr-cli edit-package-rubygems [options]
usage: copr edit-package-rubygems [-h] [--gem GEM] --name PKGNAME [--webhook-rebuild {on,off}] project
Edit source definition and type of an existing package. Options are shared with add-package-rubygems.
copr-cli list-packages [options]
usage: copr list-packages [-h] [--with-latest-build] [--with-latest-succeeded-build] [--with-all-builds] [--output-format {json, text, text-row}] project
Lists all packages in the given project in json format.
--with-latest-build
--with-latest-succeeded-build
--with-all-builds
--output-format FORMAT
copr-cli list-package-names [options]
usage: copr list-package-names [-h] project
Only list package names in the given project line by line.
copr-cli get-package [options]
usage: copr get-package [-h] --name PKGNAME [--with-latest-build] [--with-latest-succeeded-build] [--with-all-builds] [--output-format {json, text, text-row}] project
Similar to list-packages but returns just a single package directly as json structure (not wrapped in a list).
--output-format FORMAT
copr-cli delete-package [options]
usage: copr delete-package [-h] --name PKGNAME project
Deletes package and all its builds from the given project.
copr-cli reset-package [options]
usage: copr reset-package [-h] --name PKGNAME project
Clears default source of a package and its source type (all the package settings are lost after invoking this!).
copr-cli build-package [options]
usage: copr build-package [-h] [--memory MEMORY] [--timeout TIMEOUT] [--nowait] [-r CHROOTS] --name PKGNAME project
Creates a new build of the given package from its source definition.
--name PKGNAME
For the rest of the arguments, see copr-cli build command above.
copr-cli mock-config [options]
usage: copr mock-config [-h] project chroot
Get the mock profile (similar to koji mock-config), print it to standard output. The configuration can be slightly different from the real mock configuration used by Copr Builders, but should be similar enough for basic debugging (e.g. by mock --shell).
EXAMPLES
copr-cli add-package-tito myproject --name pkgname --git-url http://github.com/clime/example.git --test on
copr-cli get-package myproject --name pkgname
copr-cli build-package myproject --name pkgname --nowait --timeout 10000 -r fedora-23-x86_64
copr-cli delete-package myproject --name pkgname
copr-cli mock-config myproject fedora-rawhide-x86_64
MODULE ACTIONS
copr-cli build-module [options]
usage: copr build-module [-h] [--url URL] [--token TOKEN] [copr]
Build module via Copr MBS
--url URL: SCM with modulemd file in yaml format
--yaml YAML: Path to modulemd file in yaml format
EXAMPLES
copr-cli build-module --url git://pkgs.stg.fedoraproject.org/modules/testmodule.git?#620ec77
EXIT STATUS
Normally, the exit code is 0 when everything goes well. But if not, we could get:
1 - Bad request like wrong project name, insufficient rights etc. Also might happen when user interrupts the operation when they shouldn’t.
2 - Wrong arguments given.
3 - Bad or no configuration.
4 - Build failed or was canceled.
5 - Communication error between Cli and server. This issue probably means bug and should be reported.
6 - Configuration error.
7 - Authentication with Copr server failed.
AUTHENTICATION
Copr client supports token-based and GSSAPI authentication.
Visit the page https://copr.fedorainfracloud.org/api/ to obtain an API token. This token must be saved in the configuration file ~/.config/copr in the following format:
[copr-cli] username = msuchy login = Y57wcg==##fkfaxbkjhuoiebfafadl token = vbfseelqdebzedukgombekmuvbkqwo copr_url = https://copr.fedorainfracloud.org # expiration date: 2023-01-01
Be aware that API tokens have an expiration date!
To enable GSSAPI you need to obtain a Kerberos ticket. If you want to work with Fedora Copr, you can just do:
$ fkinit Enter your password and OTP concatenated. (Ignore that the prompt is for only the token) Enter OTP Token Value: <your password + OTP token>
To work with a different (non-Fedora Copr) instance, you will obtain the ticket differently and you still need to have a configuration file referring appropriate copr_url:
$ kinit username@EXAMPLE.COM $ cat ~/.config/copr [copr-cli] copr_url = https://copr.example.com/
Copr client uses the python API internally, for more info take a look at the page https://python-copr.readthedocs.io/en/latest/ClientV3.html#example-usage
USING DIFFERENT COPR INSTANCE
If you plan to run copr client against non-default Copr instance, the API token is available on the http://YOUR.COPR.URL/api/ page. You can either replace your default ~/.config/copr configuration file, or rather use alternative file with a shell alias
alias your_copr='copr --config ~/.config/your-copr'
inserted into your profile.
AUTHORS
Miroslav Suchý <msuchy@redhat.com>, clime <clime@redhat.com>
10/19/2024 | copr |