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 [--output-format {json, text,
396       text-row}]
397
398       Print info of the given chroot.
399
400       coprchroot
401           Path to a project chroot as owner/project/chroot or project/chroot
402
403       --output-format FORMAT
404           Set the formatting style. We recommend using json, which prints the
405           required data in json format. The text format prints the required
406           data in a column, one piece of information per line. The text-row
407           format prints all information separated by a space on a single
408           line.
409

PACKAGE ACTIONS

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

EXAMPLES

647           copr-cli add-package-tito myproject --name pkgname --git-url http://github.com/clime/example.git --test on
648
649           copr-cli get-package myproject --name pkgname
650
651           copr-cli build-package myproject --name pkgname --nowait --timeout 10000 -r fedora-23-x86_64
652
653           copr-cli delete-package myproject --name pkgname
654
655           copr-cli mock-config myproject fedora-rawhide-x86_64
656

MODULE ACTIONS

658   copr-cli build-module [options]
659       usage: copr build-module [-h] [--url URL] [--token TOKEN] [copr]
660
661       Build module via Copr MBS
662
663       --url URL: SCM with modulemd file in yaml format
664
665       --yaml YAML: Path to modulemd file in yaml format
666

EXAMPLES

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

EXIT STATUS

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

API KEY

680       Visit the page https://copr.fedorainfracloud.org/api/ to obtain an API
681       token. This token must be saved in the file ~/.config/copr in the
682       following format:
683
684           [copr-cli]
685           username = msuchy
686           login = Y57wcg==##fkfaxbkjhuoiebfafadl
687           token = vbfseelqdebzedukgombekmuvbkqwo
688           copr_url = https://copr.fedoraproject.org
689
690       Be aware that API tokens have an expiration date. The expiration date
691       for your token is listed on the /api page.
692

USING DIFFERENT COPR INSTANCE

694       If you plan to run copr client against non-default Copr instance, the
695       API token is available on the http://YOUR.COPR.URL/api/ page. You can
696       either replace your default ~/.config/copr configuration file, or
697       rather use alternative file with a shell alias
698
699           alias your_copr='copr --config ~/.config/your-copr'
700
701       inserted into your profile.
702

AUTHORS

704       Miroslav Suchý <msuchy@redhat.com>, clime <clime@redhat.com>
705
706
707
708copr                              04/27/2021                       COPR-CLI(1)
Impressum