1COPR-CLI(1)                          COPR                          COPR-CLI(1)
2
3
4

NAME

6       copr-cli - command line interface for the Copr service
7

SYNOPSIS

9       copr-cli [-h] [--version] [--config CONFIG] {list,create,build} ...
10

DESCRIPTION

12       This command allows you to interact with the Copr service from the
13       command line.
14
15       You need to to configure authentication first (see the AUTHENTICATION
16       section below).
17

OPTIONS

19       -h, --help
20           show this help message and exit
21
22       --version
23           show the program’s version number and exit
24
25       --config
26           path to an alternative configuration file (default is
27           ~/.config/copr).
28

ACTION LIST

30       list [username|@groupname]
31           List all the projects of the provided username. If no username is
32           provided, then your projects are listed.
33
34       create
35           Create a new project.
36
37       delete
38           Delete an entire project.
39
40       build
41           Build packages for a specified project.
42
43       status
44           Get the status of the build.
45
46       cancel
47           Cancel a build of given id.
48
49       download-build
50           Download a build to local directory.
51
52       modify
53           Modify existing copr
54
55       regenerate-repos
56           Regenerate repository metadata for a project
57
58       add-package-*
59           Add a new package of the specified source type (e.g.
60           add-package-tito)
61
62       edit-package-*
63           Edit source definition and type of an existing package (e.g.
64           edit-package-tito)
65
66       list-packages
67           List all packages from a copr in json format
68
69       list-package-names
70           Output just the package names from the given copr
71
72       get-package
73           Display details of a single package in json format
74
75       delete-package
76           Remove package from a copr and all its builds as well
77
78       reset-package
79           Clear source definition of a package and its source type
80
81       build-package
82           Build package from its source definition
83
84       mock-config
85           Get the mock profile (similar to koji mock-config)
86
87       build-module
88           Build module via Copr MB
89

PROJECT ACTIONS

91   copr-cli create [options]
92       usage: copr-cli create [-h] --chroot CHROOTS [--repo REPOS]
93       [--initial-pkgs PKGS] [--description DESCRIPTION] [--instructions
94       INSTRUCTIONS] [--disable_createrepo DISABLE_CREATEREPO] [--enable-net
95       {on,off}] [--unlisted-on-hp {on,off}] [--persistent] [--auto-prune
96       {on,off}] [--isolation {default, nspawn, simple}] name
97
98       --chroot
99           Chroot to use for this project. Can be specified multiple times,
100           but at least one must be present.
101
102       --repo
103           Repository to add to this project. Can be specified multiple times.
104
105       --initial-pkgs
106           List of packages to build in this new project. Can be specified
107           multiple times.
108
109       --description
110           Description of the project.
111
112       --instructions
113           Instructions for the project.
114
115       --disable_createrepo
116           Disables automatic repository metadata generation. Accepted values
117           for DISABLE_CREATEREPO: true/false.
118
119       --enable-net
120           If net should be enabled for builds in this project.
121
122       --unlisted-on-hp
123           This project will not be listed on COPR home page.
124
125       --persistent
126           Project and its builds will be undeletable. This option can only be
127           specified by a COPR admin.
128
129       --auto-prune
130           If backend auto-prunning script should be run for this project.
131           This option can only be specified by a COPR admin.
132
133       --isolation ISOLATION
134           Choose the isolation method for running commands in buildroot
135
136       name
137           Can be just name of the project or in form username/projectname or
138           @groupname/projectname.
139
140   copr-cli modify [options]
141       usage: copr-cli modify [-h] [--repo REPOS] [--chroot CHROOTS]
142       [--description DESCRIPTION] [--instructions INSTRUCTIONS]
143       [--disable_createrepo DISABLE_CREATEREPO] [--enable-net {on,off}]
144       [--unlisted-on-hp {on,off}] [--auto-prune {on,off}] [--isolation
145       {default, nspawn, simple}] name
146
147       Alters only specified project property.
148
149       --repo
150           Repository to add to this project. Can be specified multiple times.
151
152       --chroot
153           Chroot to use for this project. Can be specified multiple times.
154           When this option is not used, chroots in the project remain
155           unchanged. Once you specify a chroot, it is going to be enabled in
156           the project, but current chroots will not be preserved if they are
157           not specified.
158
159       --description
160           Description of the project.
161
162       --instructions
163           Instructions for the project.
164
165       --disable_createrepo
166           Disables automatic repository metadata generation. Accepted values
167           for DISABLE_CREATEREPO: true/false.
168
169       --enable-net
170           If networking should be enabled for builds in this project.
171
172       --unlisted-on-hp
173           This project will not be listed on COPR home page.
174
175       --auto-prune
176           If backend auto-prunning script should be run for this project.
177           This option can only be specified by a COPR admin.
178
179       --isolation ISOLATION
180           Choose the isolation method for running commands in buildroot
181
182       name
183           Can be just name of the project or in form username/projectname or
184           @groupname/projectname.
185
186   copr-cli regenerate-repos [options]
187       usage: copr-cli regenerate-repos [-h] copr
188
189       copr
190           Can be just name of the project or in form username/projectname or
191           @groupname/projectname.
192

BUILD ACTIONS

194   copr-cli build [options]
195       usage: copr-cli build [-h] [-r, --chroot CHROOTS] [--memory MEMORY]
196       [--timeout TIMEOUT] [--nowait] [--background] [--isolation {default,
197       nspawn, simple}] [--enable-net {on,off}] copr_repo PKG [PKG ...]
198
199       -r, --chroot
200           If you don’t need this build for all the project’s chroots. You can
201           use it several times for each chroot you need.
202
203       --exclude-chroot
204           If you don’t need this build for all the project’s chroots. You can
205           use it several times for each chroot you don’t need.
206
207       --memory
208           Override memory for this build. This is actually not used and it
209           have no effect.
210
211       --timeout
212           Specify build timeout (seconds), if the build takes longer than
213           that, it is terminated and fails. The default is usually set to 5
214           hours on Copr Frontend.
215
216       --nowait
217           Don’t wait for build completion.
218
219       --background
220           Run the build at a lower priority.
221
222       --isolation ISOLATION
223           Choose the isolation method for running commands in buildroot.
224
225       --enable-net
226           If networking should be enabled for this build.
227
228       copr_repo
229           The copr repository to build the package in. This can be a simple
230           name of some of your projects or it can be specified fully as
231           username/project or @groupname/project. This way you can build into
232           the project of another user or group, provided you have permissions
233           to do so. Finally, instead of just project name, you can also pass
234           project:tag. In that case, the build will land into the project
235           side repository instead of the main repository. The side repository
236           of the name project:tag will be automatically created if it doesn’t
237           exist yet. You can e.g. use this feature to launch test builds
238           while the main user-facing repository stays intact. You can specify
239           any tag that is appropriate for the given build(s).
240
241       PKG
242           This can be either file on your local workstation or URL of the
243           package to build. When URL is used, then the package must be placed
244           on a public web or ftp server. Note that you cannot combine local
245           file paths and URLs in one command line and local-file builds are
246           limited to the first specified PKG. This limitation comes from the
247           COPR API.
248
249   copr-cli buildpypi [options]
250       usage: copr buildpypi [-h] [-r, --chroot CHROOTS] [--memory MEMORY]
251       [--timeout TIMEOUT] [--nowait] [--background] [--pythonversions
252       [VERSION [VERSION ...]]] [--packageversion PYPIVERSION] --packagename
253       PYPINAME project
254
255       --pythonversions [VERSION [VERSION ...]]
256           For what Python versions to build (by default: 3 2)
257
258       --packageversion PYPIVERSION
259           Version of the PyPI package to be built (by default latest)
260
261       --packagename PYPINAME
262           Name of the PyPI package to be built, required.
263
264       For the rest of the arguments, see copr-cli build command above.
265
266   copr-cli buildscm [options]
267       usage: copr buildscm [-h] --clone-url CLONE_URL [--commit COMMITTISH]
268       [--subdir SUBDIRECTORY] [--spec SPEC] [--type {git,svn}] [--method
269       {rpkg,tito,tito_test,make_srpm}] [--memory MEMORY] [--timeout TIMEOUT]
270       [--nowait] [-r CHROOTS] [--background] copr_repo
271
272       Build package from a Git/DistGit/SVN repository.
273
274       --clone-url CLONE_URL
275           clone url to a project versioned by Git or SVN, required
276
277       --commit COMMITISH
278           branch name, tag name, or git hash to be built
279
280       --subdir SUBDIRECTORY
281           relative path from the repo root to the package content
282
283       --spec SPEC
284           relative path from the subdirectory to the .spec file
285
286       --type TYPE
287           Specify versioning tool. Default is git.
288
289       --method METHOD
290           Srpm build method. Default is rpkg.
291
292       For the rest of the arguments, see copr-cli build command above.
293
294   copr-cli download-build [options]
295       usage: copr-cli download-build [-h] [-d, --dest DESTINATION] [-r,
296       --chroot CHROOT] build_id
297
298       build_id
299           Download built packages for build identified by build_id.
300
301       -d, --dest
302           Base directory to store packages
303
304       -r, --chroot
305           Fetch only selected chroots. Can be specified multiple times.
306
307   copr-cli delete-build [options]
308       usage: copr delete-build [-h] build_id [build_id ...]
309
310       build_id
311           ID of the build to be deleted. Can be specified multiple times.
312           Note that specifying multiple build_id is much faster than calling
313           copr delete-build multiple times, because in the first case
314           createrepo is called only once.
315

EXAMPLES

317           copr-cli build myproject some.src.rpm
318           copr-cli build someone_else/project some.src.rpm
319           copr-cli build -r fedora-24-x86_64 -r fedora-24-i386 "@somegroup/project" some.src.rpm
320

CHROOT ACTIONS

322   copr-cli edit-chroot [options] coprchroot
323       usage: copr edit-chroot [-h] [--upload-comps FILEPATH | --delete-comps]
324       [--packages PACKAGES] [--repos REPOS] [--isolation {default, nspawn,
325       simple}] coprchroot
326
327       Edit the specified coprchroot.
328
329       coprchroot
330           Path to a project chroot as owner/project/chroot or project/chroot
331
332       --upload-comps FILEPATH
333           Filepath to the comps.xml file to be uploaded
334
335       --delete-comps
336           Deletes already existing comps.xml for the chroot
337
338       --packages PACKAGES
339           space separated string of package names to be added to buildroot
340           (e.g. "gcc ghc")
341
342       --repos REPOS
343           space separated string of additional repo urls for chroot (e.g.
344           "http://foo http://bar")
345
346       --isolation ISOLATION
347           Choose the isolation method for running commands in buildroot
348
349   copr-cli get-chroot coprchroot
350       usage: copr get-chroot [-h] coprchroot [--output-format {json, text,
351       text-row}]
352
353       Print info of the given chroot.
354
355       coprchroot
356           Path to a project chroot as owner/project/chroot or project/chroot
357
358       --output-format FORMAT
359           Set the formatting style. We recommend using json, which prints the
360           required data in json format. The text format prints the required
361           data in a column, one piece of information per line. The text-row
362           format prints all information separated by a space on a single
363           line.
364

PACKAGE ACTIONS

366   copr-cli add-package-pypi [options]
367       usage: copr add-package-pypi [-h] [--pythonversions [VERSION [VERSION
368       ...]]] [--packageversion PYPIVERSION] --packagename PYPINAME --name
369       PKGNAME [--webhook-rebuild {on,off}] project
370
371       Add package of PyPI source type.
372
373       --pythonversions [VERSION [VERSION ...]]
374           For what Python versions to build (by default: 3 2)
375
376       --packageversion PYPIVERSION
377           Version of the PyPI package to be built (by default latest)
378
379       --packagename PYPINAME
380           Name of the PyPI package to be built, required
381
382       --name PKGNAME
383           Name of the package to be edited or created
384
385       --webhook-rebuild {on,off}
386           Enable auto-rebuilding
387
388   copr-cli edit-package-pypi [options]
389       usage: copr edit-package-pypi [-h] [--pythonversions [VERSION [VERSION
390       ...]]] [--packageversion PYPIVERSION] --packagename PYPINAME --name
391       PKGNAME [--webhook-rebuild {on,off}] project
392
393       Edit source definition and type of an existing package. Options are
394       shared with add-package-pypi.
395
396       copr-cli add-package-scm [options]
397
398           usage: copr add-package-scm [-h] --clone-url CLONE_URL [--commit COMMITTISH]
399                                       [--subdir SUBDIRECTORY] [--spec SPEC]
400                                       [--type {git,svn}]
401                                       [--method {rpkg,tito,tito_test,make_srpm}] --name
402                                       PKGNAME [--webhook-rebuild {on,off}]
403                                       copr
404
405           Add package of SCM source type.
406
407           --clone-url CLONE_URL::
408           clone url to a project versioned by Git or SVN, required
409
410           --commit COMMITISH::
411           branch name, tag name, or git hash to be built
412
413           --subdir SUBDIRECTORY::
414           relative path from the repo root to the package content
415
416           --spec SPEC::
417           relative path from the subdirectory to the .spec file
418
419           --type TYPE::
420           Specify versioning tool. Default is 'git'.
421
422           --method METHOD::
423           Srpm build method. Default is 'rpkg'.
424
425           --name PKGNAME::
426           Name of the package to be edited or created
427
428           --webhook-rebuild {on,off}::
429           Enable auto-rebuilding
430
431
432           `copr-cli edit-package-scm [options]`
433
434       usage: copr edit-package-scm [-h] --clone-url CLONE_URL [--commit
435       COMMITTISH] [--subdir SUBDIRECTORY] [--spec SPEC] [--type {git,svn}]
436       [--method {rpkg,tito,tito_test,make_srpm}] --name PKGNAME
437       [--webhook-rebuild {on,off}] copr
438
439       Edit package of SCM source type.
440
441   copr-cli add-package-rubygems [options]
442       usage: copr add-package-rubygems [-h] [--gem GEM] --name PKGNAME
443       [--webhook-rebuild {on,off}] project
444
445       Add package of RubyGems source type.
446
447       --gem GEM
448           Specify gem name
449
450       --name PKGNAME
451           Name of the package to be edited or created
452
453       --webhook-rebuild {on,off}
454           Enable auto-rebuilding
455
456   copr-cli edit-package-rubygems [options]
457       usage: copr edit-package-rubygems [-h] [--gem GEM] --name PKGNAME
458       [--webhook-rebuild {on,off}] project
459
460       Edit source definition and type of an existing package. Options are
461       shared with add-package-rubygems.
462
463   copr-cli add-package-custom [options]
464       usage: copr add-package-custom [-h] --script SCRIPT [--script-chroot
465       SCRIPT_CHROOT] [--script-builddeps SCRIPT_BUILDDEPS]
466       [--script-resultdir SCRIPT_RESULTDIR] [--script-repos SCRIPT_REPOS]
467       --name PKGNAME [--webhook-rebuild {on,off}] [--max-builds MAX_BUILDS]
468       project
469
470       Add package of Custom source type.
471
472       --script SCRIPT
473           Text file (script) to be used to prepare the sources
474
475       --script-chroot SCRIPT_CHROOT
476           Mock chroot to build sources for the SRPM in
477
478       --script-builddeps SCRIPT_BUILDDEPS
479           Space separated list of packages needed to build the sources
480
481       --script-resultdir SCRIPT_RESULTDIR
482           Where SCRIPT generates the result, relatively to script’s $PWD
483           (defaults to .)
484
485       --script-repos SCRIPT_REPOS
486           Space separated string of additional repo urls for script
487           dependencies
488
489       --name PKGNAME
490           Name of the package to be edited or created
491
492       --webhook-rebuild {on,off}
493           Enable auto-rebuilding.
494
495       --max-builds MAX_BUILDS
496           Keep only the specified number of the newest-by-id builds (garbage
497           collector is run daily), zero disables (default)
498
499   copr-cli edit-package-custom [options]
500       usage: copr edit-package-custom [-h] --script SCRIPT [--script-chroot
501       SCRIPT_CHROOT] [--script-builddeps SCRIPT_BUILDDEPS]
502       [--script-resultdir SCRIPT_RESULTDIR] [--script-repos SCRIPT_REPOS]
503       --name PKGNAME [--webhook-rebuild {on,off}] [--max-builds MAX_BUILDS]
504       project
505
506       Edit source definition and type of an existing package. Options are
507       shared with add-package-custom.
508
509   copr-cli list-packages [options]
510       usage: copr list-packages [-h] [--with-latest-build]
511       [--with-latest-succeeded-build] [--with-all-builds] [--output-format
512       {json, text, text-row}] project
513
514       Lists all packages in the given project in json format.
515
516       --with-latest-build
517           Also display data related to the latest build for each package.
518
519       --with-latest-succeeded-build
520           Also display data related to the latest succeeded build for each
521           package.
522
523       --with-all-builds
524           Also display data related to the builds for each package.
525
526       --output-format FORMAT
527           Set the formatting style. We recommend using json, which prints the
528           required data in json format. The text format prints the required
529           data in a column, one piece of information per line. The text-row
530           format prints all information separated by a space on a single
531           line.
532
533   copr-cli list-package-names [options]
534       usage: copr list-package-names [-h] project
535
536       Only list package names in the given project line by line.
537
538   copr-cli get-package [options]
539       usage: copr get-package [-h] --name PKGNAME [--with-latest-build]
540       [--with-latest-succeeded-build] [--with-all-builds] [--output-format
541       {json, text, text-row}] project
542
543       Similar to list-packages but returns just a single package directly as
544       json structure (not wrapped in a list).
545
546       --output-format FORMAT
547           Set the formatting style. We recommend using json, which prints the
548           required data in json format. The text format prints the required
549           data in a column, one piece of information per line. The text-row
550           format prints all information separated by a space on a single
551           line.
552
553   copr-cli delete-package [options]
554       usage: copr delete-package [-h] --name PKGNAME project
555
556       Deletes package and all its builds from the given project.
557
558   copr-cli reset-package [options]
559       usage: copr reset-package [-h] --name PKGNAME project
560
561       Clears default source of a package and its source type (all the package
562       settings are lost after invoking this!).
563
564   copr-cli build-package [options]
565       usage: copr build-package [-h] [--memory MEMORY] [--timeout TIMEOUT]
566       [--nowait] [-r CHROOTS] --name PKGNAME project
567
568       Creates a new build of the given package from its source definition.
569
570       --name PKGNAME
571           Name of a package to be built
572
573       For the rest of the arguments, see copr-cli build command above.
574
575   copr-cli mock-config [options]
576       usage: copr mock-config [-h] project chroot
577
578       Get the mock profile (similar to koji mock-config), print it to
579       standard output. The configuration can be slightly different from the
580       real mock configuration used by Copr Builders, but should be similar
581       enough for basic debugging (e.g. by mock --shell).
582

EXAMPLES

584           copr-cli add-package-tito myproject --name pkgname --git-url http://github.com/clime/example.git --test on
585
586           copr-cli get-package myproject --name pkgname
587
588           copr-cli build-package myproject --name pkgname --nowait --timeout 10000 -r fedora-23-x86_64
589
590           copr-cli delete-package myproject --name pkgname
591
592           copr-cli mock-config myproject fedora-rawhide-x86_64
593

MODULE ACTIONS

595   copr-cli build-module [options]
596       usage: copr build-module [-h] [--url URL] [--token TOKEN] [copr]
597
598       Build module via Copr MBS
599
600       --url URL: SCM with modulemd file in yaml format
601
602       --yaml YAML: Path to modulemd file in yaml format
603

EXAMPLES

605           copr-cli build-module --url git://pkgs.stg.fedoraproject.org/modules/testmodule.git?#620ec77
606

EXIT STATUS

608       Normally, the exit code is 0 when everything goes well. But if not, we
609       could get:
610
611       1 - Bad request like wrong project name, insufficient rights etc. Also
612       might happen when user interrupts the operation when they shouldn’t.
613
614       2 - Wrong arguments given.
615
616       3 - Bad or no configuration.
617
618       4 - Build failed or was canceled.
619
620       5 - Communication error between Cli and server. This issue probably
621       means bug and should be reported.
622
623       6 - Configuration error.
624
625       7 - Authentication with Copr server failed.
626

AUTHENTICATION

628       Copr client supports token-based and GSSAPI authentication.
629
630       Visit the page https://copr.fedorainfracloud.org/api/ to obtain an API
631       token. This token must be saved in the configuration file
632       ~/.config/copr in the following format:
633
634           [copr-cli]
635           username = msuchy
636           login = Y57wcg==##fkfaxbkjhuoiebfafadl
637           token = vbfseelqdebzedukgombekmuvbkqwo
638           copr_url = https://copr.fedorainfracloud.org
639           # expiration date: 2023-01-01
640
641       Be aware that API tokens have an expiration date!
642
643       To enable GSSAPI you need to obtain a Kerberos ticket. If you want to
644       work with Fedora Copr, you can just do:
645
646           $ fkinit
647           Enter your password and OTP concatenated. (Ignore that the prompt is for only the token)
648           Enter OTP Token Value: <your password + OTP token>
649
650       To work with a different (non-Fedora Copr) instance, you will obtain
651       the ticket differently and you still need to have a configuration file
652       referring appropriate copr_url:
653
654           $ kinit username@EXAMPLE.COM
655           $ cat ~/.config/copr
656           [copr-cli]
657           copr_url = https://copr.example.com/
658
659       Copr client uses the python API internally, for more info take a look
660       at the page
661       https://python-copr.readthedocs.io/en/latest/ClientV3.html#example-usage
662

USING DIFFERENT COPR INSTANCE

664       If you plan to run copr client against non-default Copr instance, the
665       API token is available on the http://YOUR.COPR.URL/api/ page. You can
666       either replace your default ~/.config/copr configuration file, or
667       rather use alternative file with a shell alias
668
669           alias your_copr='copr --config ~/.config/your-copr'
670
671       inserted into your profile.
672

AUTHORS

674       Miroslav Suchý <msuchy@redhat.com>, clime <clime@redhat.com>
675
676
677
678copr                              08/15/2023                       COPR-CLI(1)
Impressum