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 generate an API key first (see the API KEY section below).
16

OPTIONS

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

ACTION LIST

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

PROJECT ACTIONS

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

BUILD ACTIONS

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

EXAMPLES

372           copr-cli build myproject some.src.rpm
373           copr-cli build someone_else/project some.src.rpm
374           copr-cli build -r fedora-24-x86_64 -r fedora-24-i386 "@somegroup/project" some.src.rpm
375

CHROOT ACTIONS

377   copr-cli edit-chroot [options] coprchroot
378       usage: copr edit-chroot [-h] [--upload-comps FILEPATH | --delete-comps]
379       [--packages PACKAGES] [--repos REPOS] [--isolation {default, nspawn,
380       simple}] coprchroot
381
382       Edit the specified coprchroot.
383
384       coprchroot
385           Path to a project chroot as owner/project/chroot or project/chroot
386
387       --upload-comps FILEPATH
388           Filepath to the comps.xml file to be uploaded
389
390       --delete-comps
391           Deletes already existing comps.xml for the chroot
392
393       --packages PACKAGES
394           space separated string of package names to be added to buildroot
395           (e.g. "gcc ghc")
396
397       --repos REPOS
398           space separated string of additional repo urls for chroot (e.g.
399           "http://foo http://bar")
400
401       --isolation ISOLATION
402           Choose the isolation method for running commands in buildroot
403
404   copr-cli get-chroot coprchroot
405       usage: copr get-chroot [-h] coprchroot [--output-format {json, text,
406       text-row}]
407
408       Print info of the given chroot.
409
410       coprchroot
411           Path to a project chroot as owner/project/chroot or project/chroot
412
413       --output-format FORMAT
414           Set the formatting style. We recommend using json, which prints the
415           required data in json format. The text format prints the required
416           data in a column, one piece of information per line. The text-row
417           format prints all information separated by a space on a single
418           line.
419

PACKAGE ACTIONS

421   copr-cli add-package-tito [options]
422       usage: copr add-package-tito [-h] --git-url URL [--git-dir DIRECTORY]
423       [--git-branch BRANCH] [--test {on,off}] --name PKGNAME
424       [--webhook-rebuild {on,off}] project
425
426       Deprecated by SCM source type.
427
428       --git-url URL
429           URL to a project managed by Tito
430
431       --git-dir DIRECTORY
432           Relative path from Git root to directory containing .spec file
433
434       --git-branch BRANCH
435           Git branch that you want to build from
436
437       --test {on,off}
438           Build the last commit instead of the last release tag
439
440       --name PKGNAME
441           Name of the package to be edited or created
442
443       --webhook-rebuild {on,off}
444           Enable auto-rebuilding.
445
446   copr-cli edit-package-tito [options]
447       usage: copr edit-package-tito [-h] --git-url URL [--git-dir DIRECTORY]
448       [--git-branch BRANCH] [--test {on,off}] --name PKGNAME
449       [--webhook-rebuild {on,off}] project
450
451       Deprecated by SCM source type.
452
453   copr-cli add-package-pypi [options]
454       usage: copr add-package-pypi [-h] [--pythonversions [VERSION [VERSION
455       ...]]] [--packageversion PYPIVERSION] --packagename PYPINAME --name
456       PKGNAME [--webhook-rebuild {on,off}] project
457
458       Add package of PyPI source type.
459
460       --pythonversions [VERSION [VERSION ...]]
461           For what Python versions to build (by default: 3 2)
462
463       --packageversion PYPIVERSION
464           Version of the PyPI package to be built (by default latest)
465
466       --packagename PYPINAME
467           Name of the PyPI package to be built, required
468
469       --name PKGNAME
470           Name of the package to be edited or created
471
472       --webhook-rebuild {on,off}
473           Enable auto-rebuilding
474
475   copr-cli edit-package-pypi [options]
476       usage: copr edit-package-pypi [-h] [--pythonversions [VERSION [VERSION
477       ...]]] [--packageversion PYPIVERSION] --packagename PYPINAME --name
478       PKGNAME [--webhook-rebuild {on,off}] project
479
480       Edit source definition and type of an existing package. Options are
481       shared with add-package-pypi.
482
483   copr-cli add-package-mockscm [options]
484       usage: copr add-package-mockscm [-h] [--scm-type TYPE] [--scm-url URL]
485       [--scm-branch BRANCH] [--spec FILE] --name PKGNAME [--webhook-rebuild
486       {on,off}] project
487
488       Deprecated by SCM source type.
489
490       --scm-type TYPE
491           Specify versioning tool, default is git
492
493       --scm-url URL
494           Url to a project versioned by Git or SVN, required
495
496       --scm-branch BRANCH
497           Branch in the target repository to build from
498
499       --spec FILE
500           Relative path from SCM root to .spec file, required
501
502       --name PKGNAME
503           Name of the package to be edited or created
504
505       --webhook-rebuild {on,off}
506           Enable auto-rebuilding
507
508   copr-cli edit-package-mockscm [options]
509       usage: copr edit-package-mockscm [-h] [--scm-type TYPE] [--scm-url URL]
510       [--scm-branch BRANCH] [--spec FILE] --name PKGNAME [--webhook-rebuild
511       {on,off}] project
512
513       Deprecated by SCM source type.
514
515       copr-cli add-package-scm [options]
516
517           usage: copr add-package-scm [-h] --clone-url CLONE_URL [--commit COMMITTISH]
518                                       [--subdir SUBDIRECTORY] [--spec SPEC]
519                                       [--type {git,svn}]
520                                       [--method {rpkg,tito,tito_test,make_srpm}] --name
521                                       PKGNAME [--webhook-rebuild {on,off}]
522                                       copr
523
524           Add package of SCM source type.
525
526           --clone-url CLONE_URL::
527           clone url to a project versioned by Git or SVN, required
528
529           --commit COMMITISH::
530           branch name, tag name, or git hash to be built
531
532           --subdir SUBDIRECTORY::
533           relative path from the repo root to the package content
534
535           --spec SPEC::
536           relative path from the subdirectory to the .spec file
537
538           --type TYPE::
539           Specify versioning tool. Default is 'git'.
540
541           --method METHOD::
542           Srpm build method. Default is 'rpkg'.
543
544           --name PKGNAME::
545           Name of the package to be edited or created
546
547           --webhook-rebuild {on,off}::
548           Enable auto-rebuilding
549
550
551           `copr-cli edit-package-scm [options]`
552
553       usage: copr edit-package-scm [-h] --clone-url CLONE_URL [--commit
554       COMMITTISH] [--subdir SUBDIRECTORY] [--spec SPEC] [--type {git,svn}]
555       [--method {rpkg,tito,tito_test,make_srpm}] --name PKGNAME
556       [--webhook-rebuild {on,off}] copr
557
558       Edit package of SCM source type.
559
560   copr-cli add-package-rubygems [options]
561       usage: copr add-package-rubygems [-h] [--gem GEM] --name PKGNAME
562       [--webhook-rebuild {on,off}] project
563
564       Add package of RubyGems source type.
565
566       --gem GEM
567           Specify gem name
568
569       --name PKGNAME
570           Name of the package to be edited or created
571
572       --webhook-rebuild {on,off}
573           Enable auto-rebuilding
574
575   copr-cli edit-package-rubygems [options]
576       usage: copr edit-package-rubygems [-h] [--gem GEM] --name PKGNAME
577       [--webhook-rebuild {on,off}] project
578
579       Edit source definition and type of an existing package. Options are
580       shared with add-package-rubygems.
581
582   copr-cli list-packages [options]
583       usage: copr list-packages [-h] [--with-latest-build]
584       [--with-latest-succeeded-build] [--with-all-builds] [--output-format
585       {json, text, text-row}] project
586
587       Lists all packages in the given project in json format.
588
589       --with-latest-build
590           Also display data related to the latest build for each package.
591
592       --with-latest-succeeded-build
593           Also display data related to the latest succeeded build for each
594           package.
595
596       --with-all-builds
597           Also display data related to the builds for each package.
598
599       --output-format FORMAT
600           Set the formatting style. We recommend using json, which prints the
601           required data in json format. The text format prints the required
602           data in a column, one piece of information per line. The text-row
603           format prints all information separated by a space on a single
604           line.
605
606   copr-cli list-package-names [options]
607       usage: copr list-package-names [-h] project
608
609       Only list package names in the given project line by line.
610
611   copr-cli get-package [options]
612       usage: copr get-package [-h] --name PKGNAME [--with-latest-build]
613       [--with-latest-succeeded-build] [--with-all-builds] [--output-format
614       {json, text, text-row}] project
615
616       Similar to list-packages but returns just a single package directly as
617       json structure (not wrapped in a list).
618
619       --output-format FORMAT
620           Set the formatting style. We recommend using json, which prints the
621           required data in json format. The text format prints the required
622           data in a column, one piece of information per line. The text-row
623           format prints all information separated by a space on a single
624           line.
625
626   copr-cli delete-package [options]
627       usage: copr delete-package [-h] --name PKGNAME project
628
629       Deletes package and all its builds from the given project.
630
631   copr-cli reset-package [options]
632       usage: copr reset-package [-h] --name PKGNAME project
633
634       Clears default source of a package and its source type (all the package
635       settings are lost after invoking this!).
636
637   copr-cli build-package [options]
638       usage: copr build-package [-h] [--memory MEMORY] [--timeout TIMEOUT]
639       [--nowait] [-r CHROOTS] --name PKGNAME project
640
641       Creates a new build of the given package from its source definition.
642
643       --name PKGNAME
644           Name of a package to be built
645
646       For the rest of the arguments, see copr-cli build command above.
647
648   copr-cli mock-config [options]
649       usage: copr mock-config [-h] project chroot
650
651       Get the mock profile (similar to koji mock-config), print it to
652       standard output. The configuration can be slightly different from the
653       real mock configuration used by Copr Builders, but should be similar
654       enough for basic debugging (e.g. by mock --shell).
655

EXAMPLES

657           copr-cli add-package-tito myproject --name pkgname --git-url http://github.com/clime/example.git --test on
658
659           copr-cli get-package myproject --name pkgname
660
661           copr-cli build-package myproject --name pkgname --nowait --timeout 10000 -r fedora-23-x86_64
662
663           copr-cli delete-package myproject --name pkgname
664
665           copr-cli mock-config myproject fedora-rawhide-x86_64
666

MODULE ACTIONS

668   copr-cli build-module [options]
669       usage: copr build-module [-h] [--url URL] [--token TOKEN] [copr]
670
671       Build module via Copr MBS
672
673       --url URL: SCM with modulemd file in yaml format
674
675       --yaml YAML: Path to modulemd file in yaml format
676

EXAMPLES

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

EXIT STATUS

681       Normally, the exit code is 0 when everything goes well. But if not, we
682       could get: 1 - Bad request like wrong project name, insufficient rights
683       etc. Also might happen when user interrupts the operation when they
684       shouldn’t. 2 - Wrong arguments given. 3 - Bad or no configuration. 4 -
685       Build fails when Cli is waiting for the result. 5 - Communication error
686       between Cli and server. This issue probably means bug and should be
687       reported.
688

API KEY

690       Visit the page https://copr.fedorainfracloud.org/api/ to obtain an API
691       token. This token must be saved in the file ~/.config/copr in the
692       following format:
693
694           [copr-cli]
695           username = msuchy
696           login = Y57wcg==##fkfaxbkjhuoiebfafadl
697           token = vbfseelqdebzedukgombekmuvbkqwo
698           copr_url = https://copr.fedoraproject.org
699
700       Be aware that API tokens have an expiration date. The expiration date
701       for your token is listed on the /api page.
702

USING DIFFERENT COPR INSTANCE

704       If you plan to run copr client against non-default Copr instance, the
705       API token is available on the http://YOUR.COPR.URL/api/ page. You can
706       either replace your default ~/.config/copr configuration file, or
707       rather use alternative file with a shell alias
708
709           alias your_copr='copr --config ~/.config/your-copr'
710
711       inserted into your profile.
712

AUTHORS

714       Miroslav Suchý <msuchy@redhat.com>, clime <clime@redhat.com>
715
716
717
718copr                              11/10/2021                       COPR-CLI(1)
Impressum