'\" t .\" Title: copr-cli .\" Author: [see the "AUTHORS" section] .\" Generator: DocBook XSL Stylesheets vsnapshot .\" Date: 10/19/2024 .\" Manual: COPR .\" Source: copr .\" Language: English .\" .TH "COPR\-CLI" "1" "10/19/2024" "copr" "COPR" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" copr-cli \- command line interface for the Copr service .SH "SYNOPSIS" .sp copr\-cli [\-h] [\-\-version] [\-\-config CONFIG] {list,create,build} \&... .SH "DESCRIPTION" .sp This command allows you to interact with the Copr service from the command line\&. .sp You need to to configure authentication first (see the AUTHENTICATION section below)\&. .SH "OPTIONS" .PP \-h, \-\-help .RS 4 show this help message and exit .RE .PP \-\-version .RS 4 show the program\(cqs version number and exit .RE .PP \-\-config .RS 4 path to an alternative configuration file (default is ~/\&.config/copr)\&. .RE .SH "ACTION LIST" .PP list [username|@groupname] .RS 4 List all the projects of the provided username\&. If no username is provided, then your projects are listed\&. .RE .PP create .RS 4 Create a new project\&. .RE .PP delete .RS 4 Delete an entire project\&. .RE .PP build .RS 4 Build packages for a specified project\&. .RE .PP status .RS 4 Get the status of the build\&. .RE .PP cancel .RS 4 Cancel a build of given id\&. .RE .PP download\-build .RS 4 Download a build to local directory\&. .RE .PP modify .RS 4 Modify existing copr .RE .PP regenerate\-repos .RS 4 Regenerate repository metadata for a project .RE .PP add\-package\-* .RS 4 Add a new package of the specified source type (e\&.g\&. add\-package\-tito) .RE .PP edit\-package\-* .RS 4 Edit source definition and type of an existing package (e\&.g\&. edit\-package\-tito) .RE .PP list\-packages .RS 4 List all packages from a copr in json format .RE .PP list\-package\-names .RS 4 Output just the package names from the given copr .RE .PP get\-package .RS 4 Display details of a single package in json format .RE .PP delete\-package .RS 4 Remove package from a copr and all its builds as well .RE .PP reset\-package .RS 4 Clear source definition of a package and its source type .RE .PP build\-package .RS 4 Build package from its source definition .RE .PP mock\-config .RS 4 Get the mock profile (similar to koji mock\-config) .RE .PP build\-module .RS 4 Build module via Copr MB .RE .SH "PROJECT ACTIONS" .SS "copr\-cli create [options]" .sp 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 .PP \-\-chroot .RS 4 Chroot to use for this project\&. Can be specified multiple times, but at least one must be present\&. .RE .PP \-\-repo .RS 4 Repository to add to this project\&. Can be specified multiple times\&. .RE .PP \-\-initial\-pkgs .RS 4 List of packages to build in this new project\&. Can be specified multiple times\&. .RE .PP \-\-description .RS 4 Description of the project\&. .RE .PP \-\-instructions .RS 4 Instructions for the project\&. .RE .PP \-\-disable_createrepo .RS 4 Disables automatic repository metadata generation\&. Accepted values for DISABLE_CREATEREPO: true/false\&. .RE .PP \-\-enable\-net .RS 4 If net should be enabled for builds in this project\&. .RE .PP \-\-unlisted\-on\-hp .RS 4 This project will not be listed on COPR home page\&. .RE .PP \-\-persistent .RS 4 Project and its builds will be undeletable\&. This option can only be specified by a COPR admin\&. .RE .PP \-\-auto\-prune .RS 4 If backend auto\-prunning script should be run for this project\&. This option can only be specified by a COPR admin\&. .RE .PP \-\-isolation ISOLATION .RS 4 Choose the isolation method for running commands in buildroot .RE .PP name .RS 4 Can be just name of the project or in form username/projectname or @groupname/projectname\&. .RE .SS "copr\-cli modify [options]" .sp 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 .sp Alters only specified project property\&. .PP \-\-repo .RS 4 Repository to add to this project\&. Can be specified multiple times\&. .RE .PP \-\-chroot .RS 4 Chroot to use for this project\&. Can be specified multiple times\&. When this option is not used, chroots in the project remain unchanged\&. Once you specify a chroot, it is going to be enabled in the project, but current chroots will not be preserved if they are not specified\&. .RE .PP \-\-description .RS 4 Description of the project\&. .RE .PP \-\-instructions .RS 4 Instructions for the project\&. .RE .PP \-\-disable_createrepo .RS 4 Disables automatic repository metadata generation\&. Accepted values for DISABLE_CREATEREPO: true/false\&. .RE .PP \-\-enable\-net .RS 4 If networking should be enabled for builds in this project\&. .RE .PP \-\-unlisted\-on\-hp .RS 4 This project will not be listed on COPR home page\&. .RE .PP \-\-auto\-prune .RS 4 If backend auto\-prunning script should be run for this project\&. This option can only be specified by a COPR admin\&. .RE .PP \-\-isolation ISOLATION .RS 4 Choose the isolation method for running commands in buildroot .RE .PP name .RS 4 Can be just name of the project or in form username/projectname or @groupname/projectname\&. .RE .SS "copr\-cli regenerate\-repos [options]" .sp usage: copr\-cli regenerate\-repos [\-h] copr .PP copr .RS 4 Can be just name of the project or in form username/projectname or @groupname/projectname\&. .RE .SH "BUILD ACTIONS" .SS "copr\-cli build [options]" .sp 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 \&...] .PP \-r, \-\-chroot .RS 4 If you don\(cqt need this build for all the project\(cqs chroots\&. You can use it several times for each chroot you need\&. .RE .PP \-\-exclude\-chroot .RS 4 If you don\(cqt need this build for all the project\(cqs chroots\&. You can use it several times for each chroot you don\(cqt need\&. .RE .PP \-\-memory .RS 4 Override memory for this build\&. This is actually not used and it have no effect\&. .RE .PP \-\-timeout .RS 4 Override timeout for this build\&. .RE .PP \-\-nowait .RS 4 Don\(cqt wait for build completion\&. .RE .PP \-\-background .RS 4 Run the build at a lower priority\&. .RE .PP \-\-isolation ISOLATION .RS 4 Choose the isolation method for running commands in buildroot\&. .RE .PP \-\-enable\-net .RS 4 If networking should be enabled for this build\&. .RE .PP copr_repo .RS 4 The copr repository to build the package in\&. This can be a simple name of some of your projects or it can be specified fully as username/project or @groupname/project\&. This way you can build into the project of another user or group, provided you have permissions to do so\&. Finally, instead of just project name, you can also pass project:tag\&. In that case, the build will land into the project side repository instead of the main repository\&. The side repository of the name project:tag will be automatically created if it doesn\(cqt exist yet\&. You can e\&.g\&. use this feature to launch test builds while the main user\-facing repository stays intact\&. You can specify any tag that is appropriate for the given build(s)\&. .RE .PP PKG .RS 4 This can be either file on your local workstation or URL of the package to build\&. When URL is used, then the package must be placed on a public web or ftp server\&. Note that you cannot combine local file paths and URLs in one command line and local\-file builds are limited to the first specified PKG\&. This limitation comes from the COPR API\&. .RE .SS "copr\-cli buildpypi [options]" .sp usage: copr buildpypi [\-h] [\-r, \-\-chroot CHROOTS] [\-\-memory MEMORY] [\-\-timeout TIMEOUT] [\-\-nowait] [\-\-background] [\-\-pythonversions [VERSION [VERSION \&...]]] [\-\-packageversion PYPIVERSION] \-\-packagename PYPINAME project .PP \-\-pythonversions [VERSION [VERSION \&...]] .RS 4 For what Python versions to build (by default: 3 2) .RE .PP \-\-packageversion PYPIVERSION .RS 4 Version of the PyPI package to be built (by default latest) .RE .PP \-\-packagename PYPINAME .RS 4 Name of the PyPI package to be built, required\&. .RE .sp For the rest of the arguments, see copr\-cli build command above\&. .SS "copr\-cli buildscm [options]" .sp 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 .sp Build package from a Git/DistGit/SVN repository\&. .PP \-\-clone\-url CLONE_URL .RS 4 clone url to a project versioned by Git or SVN, required .RE .PP \-\-commit COMMITISH .RS 4 branch name, tag name, or git hash to be built .RE .PP \-\-subdir SUBDIRECTORY .RS 4 relative path from the repo root to the package content .RE .PP \-\-spec SPEC .RS 4 relative path from the subdirectory to the \&.spec file .RE .PP \-\-type TYPE .RS 4 Specify versioning tool\&. Default is \fIgit\fR\&. .RE .PP \-\-method METHOD .RS 4 Srpm build method\&. Default is \fIrpkg\fR\&. .RE .sp For the rest of the arguments, see copr\-cli build command above\&. .SS "copr\-cli download\-build [options]" .sp usage: copr\-cli download\-build [\-h] [\-d, \-\-dest DESTINATION] [\-r, \-\-chroot CHROOT] build_id .PP build_id .RS 4 Download built packages for build identified by build_id\&. .RE .PP \-d, \-\-dest .RS 4 Base directory to store packages .RE .PP \-r, \-\-chroot .RS 4 Fetch only selected chroots\&. Can be specified multiple times\&. .RE .SS "copr\-cli delete\-build [options]" .sp usage: copr delete\-build [\-h] build_id [build_id \&...] .PP build_id .RS 4 ID of the build to be deleted\&. Can be specified multiple times\&. Note that specifying multiple build_id is much faster than calling copr delete\-build multiple times, because in the first case createrepo is called only once\&. .RE .SH "EXAMPLES" .sp .if n \{\ .RS 4 .\} .nf 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 .fi .if n \{\ .RE .\} .SH "CHROOT ACTIONS" .SS "copr\-cli edit\-chroot [options] coprchroot" .sp usage: copr edit\-chroot [\-h] [\-\-upload\-comps FILEPATH | \-\-delete\-comps] [\-\-packages PACKAGES] [\-\-repos REPOS] [\-\-isolation {default, nspawn, simple}] coprchroot .sp Edit the specified coprchroot\&. .PP coprchroot .RS 4 Path to a project chroot as owner/project/chroot or project/chroot .RE .PP \-\-upload\-comps FILEPATH .RS 4 Filepath to the comps\&.xml file to be uploaded .RE .PP \-\-delete\-comps .RS 4 Deletes already existing comps\&.xml for the chroot .RE .PP \-\-packages PACKAGES .RS 4 space separated string of package names to be added to buildroot (e\&.g\&. "gcc ghc") .RE .PP \-\-repos REPOS .RS 4 space separated string of additional repo urls for chroot (e\&.g\&. "http://foo http://bar") .RE .PP \-\-isolation ISOLATION .RS 4 Choose the isolation method for running commands in buildroot .RE .SS "copr\-cli get\-chroot coprchroot" .sp usage: copr get\-chroot [\-h] coprchroot [\-\-output\-format {json, text, text\-row}] .sp Print info of the given chroot\&. .PP coprchroot .RS 4 Path to a project chroot as owner/project/chroot or project/chroot .RE .PP \-\-output\-format FORMAT .RS 4 Set the formatting style\&. We recommend using json, which prints the required data in json format\&. The text format prints the required data in a column, one piece of information per line\&. The text\-row format prints all information separated by a space on a single line\&. .RE .SH "PACKAGE ACTIONS" .SS "copr\-cli add\-package\-pypi [options]" .sp usage: copr add\-package\-pypi [\-h] [\-\-pythonversions [VERSION [VERSION \&...]]] [\-\-packageversion PYPIVERSION] \-\-packagename PYPINAME \-\-name PKGNAME [\-\-webhook\-rebuild {on,off}] project .sp Add package of \fIPyPI\fR source type\&. .PP \-\-pythonversions [VERSION [VERSION \&...]] .RS 4 For what Python versions to build (by default: 3 2) .RE .PP \-\-packageversion PYPIVERSION .RS 4 Version of the PyPI package to be built (by default latest) .RE .PP \-\-packagename PYPINAME .RS 4 Name of the PyPI package to be built, required .RE .PP \-\-name PKGNAME .RS 4 Name of the package to be edited or created .RE .PP \-\-webhook\-rebuild {on,off} .RS 4 Enable auto\-rebuilding .RE .SS "copr\-cli edit\-package\-pypi [options]" .sp usage: copr edit\-package\-pypi [\-h] [\-\-pythonversions [VERSION [VERSION \&...]]] [\-\-packageversion PYPIVERSION] \-\-packagename PYPINAME \-\-name PKGNAME [\-\-webhook\-rebuild {on,off}] project .sp Edit source definition and type of an existing package\&. Options are shared with add\-package\-pypi\&. .sp copr\-cli add\-package\-scm [options] .sp .if n \{\ .RS 4 .\} .nf 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 \*(Aqgit\*(Aq\&. \-\-method METHOD:: Srpm build method\&. Default is \*(Aqrpkg\*(Aq\&. \-\-name PKGNAME:: Name of the package to be edited or created \-\-webhook\-rebuild {on,off}:: Enable auto\-rebuilding `copr\-cli edit\-package\-scm [options]` .fi .if n \{\ .RE .\} .sp 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 .sp Edit package of SCM source type\&. .SS "copr\-cli add\-package\-rubygems [options]" .sp usage: copr add\-package\-rubygems [\-h] [\-\-gem GEM] \-\-name PKGNAME [\-\-webhook\-rebuild {on,off}] project .sp Add package of \fIRubyGems\fR source type\&. .PP \-\-gem GEM .RS 4 Specify gem name .RE .PP \-\-name PKGNAME .RS 4 Name of the package to be edited or created .RE .PP \-\-webhook\-rebuild {on,off} .RS 4 Enable auto\-rebuilding .RE .SS "copr\-cli edit\-package\-rubygems [options]" .sp usage: copr edit\-package\-rubygems [\-h] [\-\-gem GEM] \-\-name PKGNAME [\-\-webhook\-rebuild {on,off}] project .sp Edit source definition and type of an existing package\&. Options are shared with add\-package\-rubygems\&. .SS "copr\-cli list\-packages [options]" .sp usage: copr list\-packages [\-h] [\-\-with\-latest\-build] [\-\-with\-latest\-succeeded\-build] [\-\-with\-all\-builds] [\-\-output\-format {json, text, text\-row}] project .sp Lists all packages in the given project in json format\&. .PP \-\-with\-latest\-build .RS 4 Also display data related to the latest build for each package\&. .RE .PP \-\-with\-latest\-succeeded\-build .RS 4 Also display data related to the latest succeeded build for each package\&. .RE .PP \-\-with\-all\-builds .RS 4 Also display data related to the builds for each package\&. .RE .PP \-\-output\-format FORMAT .RS 4 Set the formatting style\&. We recommend using json, which prints the required data in json format\&. The text format prints the required data in a column, one piece of information per line\&. The text\-row format prints all information separated by a space on a single line\&. .RE .SS "copr\-cli list\-package\-names [options]" .sp usage: copr list\-package\-names [\-h] project .sp Only list package names in the given project line by line\&. .SS "copr\-cli get\-package [options]" .sp usage: copr get\-package [\-h] \-\-name PKGNAME [\-\-with\-latest\-build] [\-\-with\-latest\-succeeded\-build] [\-\-with\-all\-builds] [\-\-output\-format {json, text, text\-row}] project .sp Similar to list\-packages but returns just a single package directly as json structure (not wrapped in a list)\&. .PP \-\-output\-format FORMAT .RS 4 Set the formatting style\&. We recommend using json, which prints the required data in json format\&. The text format prints the required data in a column, one piece of information per line\&. The text\-row format prints all information separated by a space on a single line\&. .RE .SS "copr\-cli delete\-package [options]" .sp usage: copr delete\-package [\-h] \-\-name PKGNAME project .sp Deletes package and all its builds from the given project\&. .SS "copr\-cli reset\-package [options]" .sp usage: copr reset\-package [\-h] \-\-name PKGNAME project .sp Clears default source of a package and its source type (all the package settings are lost after invoking this!)\&. .SS "copr\-cli build\-package [options]" .sp usage: copr build\-package [\-h] [\-\-memory MEMORY] [\-\-timeout TIMEOUT] [\-\-nowait] [\-r CHROOTS] \-\-name PKGNAME project .sp Creates a new build of the given package from its source definition\&. .PP \-\-name PKGNAME .RS 4 Name of a package to be built .RE .sp For the rest of the arguments, see copr\-cli build command above\&. .SS "copr\-cli mock\-config [options]" .sp usage: copr mock\-config [\-h] project chroot .sp 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)\&. .SH "EXAMPLES" .sp .if n \{\ .RS 4 .\} .nf copr\-cli add\-package\-tito myproject \-\-name pkgname \-\-git\-url http://github\&.com/clime/example\&.git \-\-test on .fi .if n \{\ .RE .\} .sp .if n \{\ .RS 4 .\} .nf copr\-cli get\-package myproject \-\-name pkgname .fi .if n \{\ .RE .\} .sp .if n \{\ .RS 4 .\} .nf copr\-cli build\-package myproject \-\-name pkgname \-\-nowait \-\-timeout 10000 \-r fedora\-23\-x86_64 .fi .if n \{\ .RE .\} .sp .if n \{\ .RS 4 .\} .nf copr\-cli delete\-package myproject \-\-name pkgname .fi .if n \{\ .RE .\} .sp .if n \{\ .RS 4 .\} .nf copr\-cli mock\-config myproject fedora\-rawhide\-x86_64 .fi .if n \{\ .RE .\} .SH "MODULE ACTIONS" .SS "copr\-cli build\-module [options]" .sp usage: copr build\-module [\-h] [\-\-url URL] [\-\-token TOKEN] [copr] .sp Build module via Copr MBS .sp \-\-url URL: SCM with modulemd file in yaml format .sp \-\-yaml YAML: Path to modulemd file in yaml format .SH "EXAMPLES" .sp .if n \{\ .RS 4 .\} .nf copr\-cli build\-module \-\-url git://pkgs\&.stg\&.fedoraproject\&.org/modules/testmodule\&.git?#620ec77 .fi .if n \{\ .RE .\} .SH "EXIT STATUS" .sp Normally, the exit code is 0 when everything goes well\&. But if not, we could get: .sp 1 \- Bad request like wrong project name, insufficient rights etc\&. Also might happen when user interrupts the operation when they shouldn\(cqt\&. .sp 2 \- Wrong arguments given\&. .sp 3 \- Bad or no configuration\&. .sp 4 \- Build failed or was canceled\&. .sp 5 \- Communication error between Cli and server\&. This issue probably means bug and should be reported\&. .sp 6 \- Configuration error\&. .sp 7 \- Authentication with Copr server failed\&. .SH "AUTHENTICATION" .sp Copr client supports token\-based and GSSAPI authentication\&. .sp 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: .sp .if n \{\ .RS 4 .\} .nf [copr\-cli] username = msuchy login = Y57wcg==##fkfaxbkjhuoiebfafadl token = vbfseelqdebzedukgombekmuvbkqwo copr_url = https://copr\&.fedorainfracloud\&.org # expiration date: 2023\-01\-01 .fi .if n \{\ .RE .\} .sp Be aware that API tokens have an expiration date! .sp To enable GSSAPI you need to obtain a Kerberos ticket\&. If you want to work with Fedora Copr, you can just do: .sp .if n \{\ .RS 4 .\} .nf $ fkinit Enter your password and OTP concatenated\&. (Ignore that the prompt is for only the token) Enter OTP Token Value: .fi .if n \{\ .RE .\} .sp 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: .sp .if n \{\ .RS 4 .\} .nf $ kinit username@EXAMPLE\&.COM $ cat ~/\&.config/copr [copr\-cli] copr_url = https://copr\&.example\&.com/ .fi .if n \{\ .RE .\} .sp 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 .SH "USING DIFFERENT COPR INSTANCE" .sp 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 .sp .if n \{\ .RS 4 .\} .nf alias your_copr=\*(Aqcopr \-\-config ~/\&.config/your\-copr\*(Aq .fi .if n \{\ .RE .\} .sp inserted into your profile\&. .SH "AUTHORS" .sp Miroslav Suchý , clime