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       add-package-*
55           Add a new package of the specified source type (e.g.
56           add-package-tito)
57
58       edit-package-*
59           Edit source definition and type of an existing package (e.g.
60           edit-package-tito)
61
62       list-packages
63           List all packages from a copr in json format
64
65       list-package-names
66           Output just the package names from the given copr
67
68       get-package
69           Display details of a single package in json format
70
71       delete-package
72           Remove package from a copr and all its builds as well
73
74       reset-package
75           Clear source definition of a package and its source type
76
77       build-package
78           Build package from its source definition
79
80       mock-config
81           Get the mock profile (similar to koji mock-config)
82
83       build-module
84           Build module via Copr MB
85

PROJECT ACTIONS

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

BUILD ACTIONS

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

EXAMPLES

362           copr-cli build myproject some.src.rpm
363           copr-cli build someone_else/project some.src.rpm
364           copr-cli build -r fedora-24-x86_64 -r fedora-24-i386 "@somegroup/project" some.src.rpm
365

CHROOT ACTIONS

367   copr-cli edit-chroot [options] coprchroot
368       usage: copr edit-chroot [-h] [--upload-comps FILEPATH | --delete-comps]
369       [--packages PACKAGES] [--repos REPOS] [--isolation {default, nspawn,
370       simple}] coprchroot
371
372       Edit the specified coprchroot.
373
374       coprchroot
375           Path to a project chroot as owner/project/chroot or project/chroot
376
377       --upload-comps FILEPATH
378           Filepath to the comps.xml file to be uploaded
379
380       --delete-comps
381           Deletes already existing comps.xml for the chroot
382
383       --packages PACKAGES
384           space separated string of package names to be added to buildroot
385           (e.g. "gcc ghc")
386
387       --repos REPOS
388           space separated string of additional repo urls for chroot (e.g.
389           "http://foo http://bar")
390
391       --isolation ISOLATION
392           Choose the isolation method for running commands in buildroot
393
394   copr-cli get-chroot coprchroot
395       usage: copr get-chroot [-h] coprchroot
396
397       Print info of the given chroot.
398
399       coprchroot
400           Path to a project chroot as owner/project/chroot or project/chroot
401

PACKAGE ACTIONS

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

EXAMPLES

623           copr-cli add-package-tito myproject --name pkgname --git-url http://github.com/clime/example.git --test on
624
625           copr-cli get-package myproject --name pkgname
626
627           copr-cli build-package myproject --name pkgname --nowait --timeout 10000 -r fedora-23-x86_64
628
629           copr-cli delete-package myproject --name pkgname
630
631           copr-cli mock-config myproject fedora-rawhide-x86_64
632

MODULE ACTIONS

634   copr-cli build-module [options]
635       usage: copr build-module [-h] [--url URL] [--token TOKEN] [copr]
636
637       Build module via Copr MBS
638
639       --url URL: SCM with modulemd file in yaml format
640
641       --yaml YAML: Path to modulemd file in yaml format
642

EXAMPLES

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

EXIT STATUS

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

API KEY

656       Visit the page https://copr.fedorainfracloud.org/api/ to obtain an API
657       token. This token must be saved in the file ~/.config/copr in the
658       following format:
659
660           [copr-cli]
661           username = msuchy
662           login = Y57wcg==##fkfaxbkjhuoiebfafadl
663           token = vbfseelqdebzedukgombekmuvbkqwo
664           copr_url = https://copr.fedoraproject.org
665
666       Be aware that API tokens have an expiration date. The expiration date
667       for your token is listed on the /api page.
668

USING DIFFERENT COPR INSTANCE

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

AUTHORS

680       Miroslav Suchý <msuchy@redhat.com>, clime <clime@redhat.com>
681
682
683
684copr                              03/16/2021                       COPR-CLI(1)
Impressum