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}] 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       name
130           Can be just name of the project or in form username/projectname or
131           @groupname/projectname.
132
133   copr-cli modify [options]
134       usage: copr-cli modify [-h] [--repo REPOS] [--chroot CHROOTS]
135       [--description DESCRIPTION] [--instructions INSTRUCTIONS]
136       [--disable_createrepo DISABLE_CREATEREPO] [--enable-net {on,off}]
137       [--unlisted-on-hp {on,off}] [--auto-prune {on,off}] name
138
139       Alters only specified project property.
140
141       --repo
142           Repository to add to this project. Can be specified multiple times.
143
144       --chroot
145           Chroot to use for this project. Can be specified multiple times.
146           When this option is not used, chroots in the project remain
147           unchanged. Once you specify a chroot, it is going to be enabled in
148           the project, but current chroots will not be preserved if they are
149           not specified.
150
151       --description
152           Description of the project.
153
154       --instructions
155           Instructions for the project.
156
157       --disable_createrepo
158           Disables automatic repository metadata generation. Accepted values
159           for DISABLE_CREATEREPO: true/false.
160
161       --enable-net
162           If net should be enabled for builds in this project.
163
164       --unlisted-on-hp
165           This project will not be listed on COPR home page.
166
167       --auto-prune
168           If backend auto-prunning script should be run for this project.
169           This option can only be specified by a COPR admin.
170
171       name
172           Can be just name of the project or in form username/projectname or
173           @groupname/projectname.
174

BUILD ACTIONS

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

EXAMPLES

342           copr-cli build myproject some.src.rpm
343           copr-cli build someone_else/project some.src.rpm
344           copr-cli build -r fedora-24-x86_64 -r fedora-24-i386 "@somegroup/project" some.src.rpm
345

CHROOT ACTIONS

347   copr-cli edit-chroot [options] coprchroot
348       usage: copr edit-chroot [-h] [--upload-comps FILEPATH | --delete-comps]
349       [--packages PACKAGES] [--repos REPOS] coprchroot
350
351       Edit the specified coprchroot.
352
353       coprchroot
354           Path to a project chroot as owner/project/chroot or project/chroot
355
356       --upload-comps FILEPATH
357           Filepath to the comps.xml file to be uploaded
358
359       --delete-comps
360           Deletes already existing comps.xml for the chroot
361
362       --packages PACKAGES
363           space separated string of package names to be added to buildroot
364           (e.g. "gcc ghc")
365
366       --repos REPOS
367           space separated string of additional repo urls for chroot (e.g.
368           "http://foo http://bar")
369
370   copr-cli get-chroot coprchroot
371       usage: copr get-chroot [-h] coprchroot
372
373       Print info of the given chroot.
374
375       coprchroot
376           Path to a project chroot as owner/project/chroot or project/chroot
377

PACKAGE ACTIONS

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

EXAMPLES

599           copr-cli add-package-tito myproject --name pkgname --git-url http://github.com/clime/example.git --test on
600
601           copr-cli get-package myproject --name pkgname
602
603           copr-cli build-package myproject --name pkgname --nowait --timeout 10000 -r fedora-23-x86_64
604
605           copr-cli delete-package myproject --name pkgname
606
607           copr-cli mock-config myproject fedora-rawhide-x86_64
608

MODULE ACTIONS

610   copr-cli build-module [options]
611       usage: copr build-module [-h] [--url URL] [--token TOKEN] [copr]
612
613       Build module via Copr MBS
614
615       --url URL: SCM with modulemd file in yaml format
616
617       --yaml YAML: Path to modulemd file in yaml format
618

EXAMPLES

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

EXIT STATUS

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

API KEY

632       Visit the page https://copr.fedorainfracloud.org/api/ to obtain an API
633       token. This token must be saved in the file ~/.config/copr in the
634       following format:
635
636           [copr-cli]
637           username = msuchy
638           login = Y57wcg==##fkfaxbkjhuoiebfafadl
639           token = vbfseelqdebzedukgombekmuvbkqwo
640           copr_url = https://copr.fedoraproject.org
641
642       Be aware that API tokens have an expiration date. The expiration date
643       for your token is listed on the /api page.
644

USING DIFFERENT COPR INSTANCE

646       If you plan to run copr client against non-default Copr instance, the
647       API token is available on the http://YOUR.COPR.URL/api/ page. You can
648       either replace your default ~/.config/copr configuration file, or
649       rather use alternative file with a shell alias
650
651           alias your_copr='copr --config ~/.config/your-copr'
652
653       inserted into your profile.
654

AUTHORS

656       Miroslav Suchý <msuchy@redhat.com>, clime <clime@redhat.com>
657
658
659
660copr                              03/18/2020                       COPR-CLI(1)
Impressum