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           DEPRECATED. Get the mock profile (similar to koji mock-config).
82           Please, take a look at copr-rpmbuild --dump-configs if you search
83           for replacement. On EPEL, you can install it from:
84           https://copr.fedorainfracloud.org/coprs/g/copr/copr-rpmbuild
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}] 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       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}] name
141
142       Alters only specified project property.
143
144       --repo
145           Repository to add to this project. Can be specified multiple times.
146
147       --chroot
148           Chroot to use for this project. Can be specified multiple times.
149           When this option is not used, chroots in the project remain
150           unchanged. Once you specify a chroot, it is going to be enabled in
151           the project, but current chroots will not be preserved if they are
152           not specified.
153
154       --description
155           Description of the project.
156
157       --instructions
158           Instructions for the project.
159
160       --disable_createrepo
161           Disables automatic repository metadata generation. Accepted values
162           for DISABLE_CREATEREPO: true/false.
163
164       --enable-net
165           If net should be enabled for builds in this project.
166
167       --unlisted-on-hp
168           This project will not be listed on COPR home page.
169
170       --auto-prune
171           If backend auto-prunning script should be run for this project.
172           This option can only be specified by a COPR admin.
173
174       name
175           Can be just name of the project or in form username/projectname or
176           @groupname/projectname.
177

BUILD ACTIONS

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

EXAMPLES

345           copr-cli build myproject some.src.rpm
346           copr-cli build someone_else/project some.src.rpm
347           copr-cli build -r fedora-24-x86_64 -r fedora-24-i386 "@somegroup/project" some.src.rpm
348

CHROOT ACTIONS

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

PACKAGE ACTIONS

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

EXAMPLES

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

MODULE ACTIONS

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

EXAMPLES

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

EXIT STATUS

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

API KEY

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

USING DIFFERENT COPR INSTANCE

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

AUTHORS

659       Miroslav Suchý <msuchy@redhat.com>, clime <clime@redhat.com>
660
661
662
663copr                              04/24/2019                       COPR-CLI(1)
Impressum