1COPR-CLI(1) COPR COPR-CLI(1)
2
3
4
6 copr-cli - command line interface for the Copr service
7
9 copr-cli [-h] [--version] [--config CONFIG] {list,create,build} ...
10
12 This command allows you to interact with the Copr service from the
13 command line.
14
15 You need to to configure authentication first (see the AUTHENTICATION
16 section below).
17
19 -h, --help
20 show this help message and exit
21
22 --version
23 show the program’s version number and exit
24
25 --config
26 path to an alternative configuration file (default is
27 ~/.config/copr).
28
30 list [username|@groupname]
31 List all the projects of the provided username. If no username is
32 provided, then your projects are listed.
33
34 create
35 Create a new project.
36
37 delete
38 Delete an entire project.
39
40 build
41 Build packages for a specified project.
42
43 status
44 Get the status of the build.
45
46 cancel
47 Cancel a build of given id.
48
49 download-build
50 Download a build to local directory.
51
52 modify
53 Modify existing copr
54
55 regenerate-repos
56 Regenerate repository metadata for a project
57
58 add-package-*
59 Add a new package of the specified source type (e.g.
60 add-package-tito)
61
62 edit-package-*
63 Edit source definition and type of an existing package (e.g.
64 edit-package-tito)
65
66 list-packages
67 List all packages from a copr in json format
68
69 list-package-names
70 Output just the package names from the given copr
71
72 get-package
73 Display details of a single package in json format
74
75 delete-package
76 Remove package from a copr and all its builds as well
77
78 reset-package
79 Clear source definition of a package and its source type
80
81 build-package
82 Build package from its source definition
83
84 mock-config
85 Get the mock profile (similar to koji mock-config)
86
87 build-module
88 Build module via Copr MB
89
91 copr-cli create [options]
92 usage: copr-cli create [-h] --chroot CHROOTS [--repo REPOS]
93 [--initial-pkgs PKGS] [--description DESCRIPTION] [--instructions
94 INSTRUCTIONS] [--disable_createrepo DISABLE_CREATEREPO] [--enable-net
95 {on,off}] [--unlisted-on-hp {on,off}] [--persistent] [--auto-prune
96 {on,off}] [--isolation {default, nspawn, simple}] name
97
98 --chroot
99 Chroot to use for this project. Can be specified multiple times,
100 but at least one must be present.
101
102 --repo
103 Repository to add to this project. Can be specified multiple times.
104
105 --initial-pkgs
106 List of packages to build in this new project. Can be specified
107 multiple times.
108
109 --description
110 Description of the project.
111
112 --instructions
113 Instructions for the project.
114
115 --disable_createrepo
116 Disables automatic repository metadata generation. Accepted values
117 for DISABLE_CREATEREPO: true/false.
118
119 --enable-net
120 If net should be enabled for builds in this project.
121
122 --unlisted-on-hp
123 This project will not be listed on COPR home page.
124
125 --persistent
126 Project and its builds will be undeletable. This option can only be
127 specified by a COPR admin.
128
129 --auto-prune
130 If backend auto-prunning script should be run for this project.
131 This option can only be specified by a COPR admin.
132
133 --isolation ISOLATION
134 Choose the isolation method for running commands in buildroot
135
136 name
137 Can be just name of the project or in form username/projectname or
138 @groupname/projectname.
139
140 copr-cli modify [options]
141 usage: copr-cli modify [-h] [--repo REPOS] [--chroot CHROOTS]
142 [--description DESCRIPTION] [--instructions INSTRUCTIONS]
143 [--disable_createrepo DISABLE_CREATEREPO] [--enable-net {on,off}]
144 [--unlisted-on-hp {on,off}] [--auto-prune {on,off}] [--isolation
145 {default, nspawn, simple}] name
146
147 Alters only specified project property.
148
149 --repo
150 Repository to add to this project. Can be specified multiple times.
151
152 --chroot
153 Chroot to use for this project. Can be specified multiple times.
154 When this option is not used, chroots in the project remain
155 unchanged. Once you specify a chroot, it is going to be enabled in
156 the project, but current chroots will not be preserved if they are
157 not specified.
158
159 --description
160 Description of the project.
161
162 --instructions
163 Instructions for the project.
164
165 --disable_createrepo
166 Disables automatic repository metadata generation. Accepted values
167 for DISABLE_CREATEREPO: true/false.
168
169 --enable-net
170 If networking should be enabled for builds in this project.
171
172 --unlisted-on-hp
173 This project will not be listed on COPR home page.
174
175 --auto-prune
176 If backend auto-prunning script should be run for this project.
177 This option can only be specified by a COPR admin.
178
179 --isolation ISOLATION
180 Choose the isolation method for running commands in buildroot
181
182 name
183 Can be just name of the project or in form username/projectname or
184 @groupname/projectname.
185
186 copr-cli regenerate-repos [options]
187 usage: copr-cli regenerate-repos [-h] copr
188
189 copr
190 Can be just name of the project or in form username/projectname or
191 @groupname/projectname.
192
194 copr-cli build [options]
195 usage: copr-cli build [-h] [-r, --chroot CHROOTS] [--memory MEMORY]
196 [--timeout TIMEOUT] [--nowait] [--background] [--isolation {default,
197 nspawn, simple}] [--enable-net {on,off}] copr_repo PKG [PKG ...]
198
199 -r, --chroot
200 If you don’t need this build for all the project’s chroots. You can
201 use it several times for each chroot you need.
202
203 --exclude-chroot
204 If you don’t need this build for all the project’s chroots. You can
205 use it several times for each chroot you don’t need.
206
207 --memory
208 Override memory for this build. This is actually not used and it
209 have no effect.
210
211 --timeout
212 Override timeout for this build.
213
214 --nowait
215 Don’t wait for build completion.
216
217 --background
218 Run the build at a lower priority.
219
220 --isolation ISOLATION
221 Choose the isolation method for running commands in buildroot.
222
223 --enable-net
224 If networking should be enabled for this build.
225
226 copr_repo
227 The copr repository to build the package in. This can be a simple
228 name of some of your projects or it can be specified fully as
229 username/project or @groupname/project. This way you can build into
230 the project of another user or group, provided you have permissions
231 to do so. Finally, instead of just project name, you can also pass
232 project:tag. In that case, the build will land into the project
233 side repository instead of the main repository. The side repository
234 of the name project:tag will be automatically created if it doesn’t
235 exist yet. You can e.g. use this feature to launch test builds
236 while the main user-facing repository stays intact. You can specify
237 any tag that is appropriate for the given build(s).
238
239 PKG
240 This can be either file on your local workstation or URL of the
241 package to build. When URL is used, then the package must be placed
242 on a public web or ftp server. Note that you cannot combine local
243 file paths and URLs in one command line and local-file builds are
244 limited to the first specified PKG. This limitation comes from the
245 COPR API.
246
247 copr-cli buildpypi [options]
248 usage: copr buildpypi [-h] [-r, --chroot CHROOTS] [--memory MEMORY]
249 [--timeout TIMEOUT] [--nowait] [--background] [--pythonversions
250 [VERSION [VERSION ...]]] [--packageversion PYPIVERSION] --packagename
251 PYPINAME project
252
253 --pythonversions [VERSION [VERSION ...]]
254 For what Python versions to build (by default: 3 2)
255
256 --packageversion PYPIVERSION
257 Version of the PyPI package to be built (by default latest)
258
259 --packagename PYPINAME
260 Name of the PyPI package to be built, required.
261
262 For the rest of the arguments, see copr-cli build command above.
263
264 copr-cli buildscm [options]
265 usage: copr buildscm [-h] --clone-url CLONE_URL [--commit COMMITTISH]
266 [--subdir SUBDIRECTORY] [--spec SPEC] [--type {git,svn}] [--method
267 {rpkg,tito,tito_test,make_srpm}] [--memory MEMORY] [--timeout TIMEOUT]
268 [--nowait] [-r CHROOTS] [--background] copr_repo
269
270 Build package from a Git/DistGit/SVN repository.
271
272 --clone-url CLONE_URL
273 clone url to a project versioned by Git or SVN, required
274
275 --commit COMMITISH
276 branch name, tag name, or git hash to be built
277
278 --subdir SUBDIRECTORY
279 relative path from the repo root to the package content
280
281 --spec SPEC
282 relative path from the subdirectory to the .spec file
283
284 --type TYPE
285 Specify versioning tool. Default is git.
286
287 --method METHOD
288 Srpm build method. Default is rpkg.
289
290 For the rest of the arguments, see copr-cli build command above.
291
292 copr-cli download-build [options]
293 usage: copr-cli download-build [-h] [-d, --dest DESTINATION] [-r,
294 --chroot CHROOT] build_id
295
296 build_id
297 Download built packages for build identified by build_id.
298
299 -d, --dest
300 Base directory to store packages
301
302 -r, --chroot
303 Fetch only selected chroots. Can be specified multiple times.
304
305 copr-cli delete-build [options]
306 usage: copr delete-build [-h] build_id [build_id ...]
307
308 build_id
309 ID of the build to be deleted. Can be specified multiple times.
310 Note that specifying multiple build_id is much faster than calling
311 copr delete-build multiple times, because in the first case
312 createrepo is called only once.
313
315 copr-cli build myproject some.src.rpm
316 copr-cli build someone_else/project some.src.rpm
317 copr-cli build -r fedora-24-x86_64 -r fedora-24-i386 "@somegroup/project" some.src.rpm
318
320 copr-cli edit-chroot [options] coprchroot
321 usage: copr edit-chroot [-h] [--upload-comps FILEPATH | --delete-comps]
322 [--packages PACKAGES] [--repos REPOS] [--isolation {default, nspawn,
323 simple}] coprchroot
324
325 Edit the specified coprchroot.
326
327 coprchroot
328 Path to a project chroot as owner/project/chroot or project/chroot
329
330 --upload-comps FILEPATH
331 Filepath to the comps.xml file to be uploaded
332
333 --delete-comps
334 Deletes already existing comps.xml for the chroot
335
336 --packages PACKAGES
337 space separated string of package names to be added to buildroot
338 (e.g. "gcc ghc")
339
340 --repos REPOS
341 space separated string of additional repo urls for chroot (e.g.
342 "http://foo http://bar")
343
344 --isolation ISOLATION
345 Choose the isolation method for running commands in buildroot
346
347 copr-cli get-chroot coprchroot
348 usage: copr get-chroot [-h] coprchroot [--output-format {json, text,
349 text-row}]
350
351 Print info of the given chroot.
352
353 coprchroot
354 Path to a project chroot as owner/project/chroot or project/chroot
355
356 --output-format FORMAT
357 Set the formatting style. We recommend using json, which prints the
358 required data in json format. The text format prints the required
359 data in a column, one piece of information per line. The text-row
360 format prints all information separated by a space on a single
361 line.
362
364 copr-cli add-package-pypi [options]
365 usage: copr add-package-pypi [-h] [--pythonversions [VERSION [VERSION
366 ...]]] [--packageversion PYPIVERSION] --packagename PYPINAME --name
367 PKGNAME [--webhook-rebuild {on,off}] project
368
369 Add package of PyPI source type.
370
371 --pythonversions [VERSION [VERSION ...]]
372 For what Python versions to build (by default: 3 2)
373
374 --packageversion PYPIVERSION
375 Version of the PyPI package to be built (by default latest)
376
377 --packagename PYPINAME
378 Name of the PyPI package to be built, required
379
380 --name PKGNAME
381 Name of the package to be edited or created
382
383 --webhook-rebuild {on,off}
384 Enable auto-rebuilding
385
386 copr-cli edit-package-pypi [options]
387 usage: copr edit-package-pypi [-h] [--pythonversions [VERSION [VERSION
388 ...]]] [--packageversion PYPIVERSION] --packagename PYPINAME --name
389 PKGNAME [--webhook-rebuild {on,off}] project
390
391 Edit source definition and type of an existing package. Options are
392 shared with add-package-pypi.
393
394 copr-cli add-package-scm [options]
395
396 usage: copr add-package-scm [-h] --clone-url CLONE_URL [--commit COMMITTISH]
397 [--subdir SUBDIRECTORY] [--spec SPEC]
398 [--type {git,svn}]
399 [--method {rpkg,tito,tito_test,make_srpm}] --name
400 PKGNAME [--webhook-rebuild {on,off}]
401 copr
402
403 Add package of SCM source type.
404
405 --clone-url CLONE_URL::
406 clone url to a project versioned by Git or SVN, required
407
408 --commit COMMITISH::
409 branch name, tag name, or git hash to be built
410
411 --subdir SUBDIRECTORY::
412 relative path from the repo root to the package content
413
414 --spec SPEC::
415 relative path from the subdirectory to the .spec file
416
417 --type TYPE::
418 Specify versioning tool. Default is 'git'.
419
420 --method METHOD::
421 Srpm build method. Default is 'rpkg'.
422
423 --name PKGNAME::
424 Name of the package to be edited or created
425
426 --webhook-rebuild {on,off}::
427 Enable auto-rebuilding
428
429
430 `copr-cli edit-package-scm [options]`
431
432 usage: copr edit-package-scm [-h] --clone-url CLONE_URL [--commit
433 COMMITTISH] [--subdir SUBDIRECTORY] [--spec SPEC] [--type {git,svn}]
434 [--method {rpkg,tito,tito_test,make_srpm}] --name PKGNAME
435 [--webhook-rebuild {on,off}] copr
436
437 Edit package of SCM source type.
438
439 copr-cli add-package-rubygems [options]
440 usage: copr add-package-rubygems [-h] [--gem GEM] --name PKGNAME
441 [--webhook-rebuild {on,off}] project
442
443 Add package of RubyGems source type.
444
445 --gem GEM
446 Specify gem name
447
448 --name PKGNAME
449 Name of the package to be edited or created
450
451 --webhook-rebuild {on,off}
452 Enable auto-rebuilding
453
454 copr-cli edit-package-rubygems [options]
455 usage: copr edit-package-rubygems [-h] [--gem GEM] --name PKGNAME
456 [--webhook-rebuild {on,off}] project
457
458 Edit source definition and type of an existing package. Options are
459 shared with add-package-rubygems.
460
461 copr-cli list-packages [options]
462 usage: copr list-packages [-h] [--with-latest-build]
463 [--with-latest-succeeded-build] [--with-all-builds] [--output-format
464 {json, text, text-row}] project
465
466 Lists all packages in the given project in json format.
467
468 --with-latest-build
469 Also display data related to the latest build for each package.
470
471 --with-latest-succeeded-build
472 Also display data related to the latest succeeded build for each
473 package.
474
475 --with-all-builds
476 Also display data related to the builds for each package.
477
478 --output-format FORMAT
479 Set the formatting style. We recommend using json, which prints the
480 required data in json format. The text format prints the required
481 data in a column, one piece of information per line. The text-row
482 format prints all information separated by a space on a single
483 line.
484
485 copr-cli list-package-names [options]
486 usage: copr list-package-names [-h] project
487
488 Only list package names in the given project line by line.
489
490 copr-cli get-package [options]
491 usage: copr get-package [-h] --name PKGNAME [--with-latest-build]
492 [--with-latest-succeeded-build] [--with-all-builds] [--output-format
493 {json, text, text-row}] project
494
495 Similar to list-packages but returns just a single package directly as
496 json structure (not wrapped in a list).
497
498 --output-format FORMAT
499 Set the formatting style. We recommend using json, which prints the
500 required data in json format. The text format prints the required
501 data in a column, one piece of information per line. The text-row
502 format prints all information separated by a space on a single
503 line.
504
505 copr-cli delete-package [options]
506 usage: copr delete-package [-h] --name PKGNAME project
507
508 Deletes package and all its builds from the given project.
509
510 copr-cli reset-package [options]
511 usage: copr reset-package [-h] --name PKGNAME project
512
513 Clears default source of a package and its source type (all the package
514 settings are lost after invoking this!).
515
516 copr-cli build-package [options]
517 usage: copr build-package [-h] [--memory MEMORY] [--timeout TIMEOUT]
518 [--nowait] [-r CHROOTS] --name PKGNAME project
519
520 Creates a new build of the given package from its source definition.
521
522 --name PKGNAME
523 Name of a package to be built
524
525 For the rest of the arguments, see copr-cli build command above.
526
527 copr-cli mock-config [options]
528 usage: copr mock-config [-h] project chroot
529
530 Get the mock profile (similar to koji mock-config), print it to
531 standard output. The configuration can be slightly different from the
532 real mock configuration used by Copr Builders, but should be similar
533 enough for basic debugging (e.g. by mock --shell).
534
536 copr-cli add-package-tito myproject --name pkgname --git-url http://github.com/clime/example.git --test on
537
538 copr-cli get-package myproject --name pkgname
539
540 copr-cli build-package myproject --name pkgname --nowait --timeout 10000 -r fedora-23-x86_64
541
542 copr-cli delete-package myproject --name pkgname
543
544 copr-cli mock-config myproject fedora-rawhide-x86_64
545
547 copr-cli build-module [options]
548 usage: copr build-module [-h] [--url URL] [--token TOKEN] [copr]
549
550 Build module via Copr MBS
551
552 --url URL: SCM with modulemd file in yaml format
553
554 --yaml YAML: Path to modulemd file in yaml format
555
557 copr-cli build-module --url git://pkgs.stg.fedoraproject.org/modules/testmodule.git?#620ec77
558
560 Normally, the exit code is 0 when everything goes well. But if not, we
561 could get:
562
563 1 - Bad request like wrong project name, insufficient rights etc. Also
564 might happen when user interrupts the operation when they shouldn’t.
565
566 2 - Wrong arguments given.
567
568 3 - Bad or no configuration.
569
570 4 - Build failed or was canceled.
571
572 5 - Communication error between Cli and server. This issue probably
573 means bug and should be reported.
574
575 6 - Configuration error.
576
577 7 - Authentication with Copr server failed.
578
580 Copr client supports token-based and GSSAPI authentication.
581
582 Visit the page https://copr.fedorainfracloud.org/api/ to obtain an API
583 token. This token must be saved in the configuration file
584 ~/.config/copr in the following format:
585
586 [copr-cli]
587 username = msuchy
588 login = Y57wcg==##fkfaxbkjhuoiebfafadl
589 token = vbfseelqdebzedukgombekmuvbkqwo
590 copr_url = https://copr.fedorainfracloud.org
591 # expiration date: 2023-01-01
592
593 Be aware that API tokens have an expiration date!
594
595 To enable GSSAPI you need to obtain a Kerberos ticket. If you want to
596 work with Fedora Copr, you can just do:
597
598 $ fkinit
599 Enter your password and OTP concatenated. (Ignore that the prompt is for only the token)
600 Enter OTP Token Value: <your password + OTP token>
601
602 To work with a different (non-Fedora Copr) instance, you will obtain
603 the ticket differently and you still need to have a configuration file
604 referring appropriate copr_url:
605
606 $ kinit username@EXAMPLE.COM
607 $ cat ~/.config/copr
608 [copr-cli]
609 copr_url = https://copr.example.com/
610
611 Copr client uses the python API internally, for more info take a look
612 at the page
613 https://python-copr.readthedocs.io/en/latest/ClientV3.html#example-usage
614
616 If you plan to run copr client against non-default Copr instance, the
617 API token is available on the http://YOUR.COPR.URL/api/ page. You can
618 either replace your default ~/.config/copr configuration file, or
619 rather use alternative file with a shell alias
620
621 alias your_copr='copr --config ~/.config/your-copr'
622
623 inserted into your profile.
624
626 Miroslav Suchý <msuchy@redhat.com>, clime <clime@redhat.com>
627
628
629
630copr 06/21/2022 COPR-CLI(1)