mirror of
https://codeberg.org/guix/guix.git
synced 2025-10-02 02:15:12 +00:00
deploy: Gracefully handle errors.
* guix/scripts/deploy.scm (guix-deploy): Wrap body in 'with-error-handling'.
This commit is contained in:
parent
cfd8daaf07
commit
c9c8c6331e
1 changed files with 15 additions and 14 deletions
|
@ -140,18 +140,19 @@ Perform the deployment specified by FILE.\n"))
|
||||||
(define (handle-argument arg result)
|
(define (handle-argument arg result)
|
||||||
(alist-cons 'file arg result))
|
(alist-cons 'file arg result))
|
||||||
|
|
||||||
(let* ((opts (parse-command-line args %options (list %default-options)
|
(with-error-handling
|
||||||
#:argument-handler handle-argument))
|
(let* ((opts (parse-command-line args %options (list %default-options)
|
||||||
(file (assq-ref opts 'file))
|
#:argument-handler handle-argument))
|
||||||
(machines (or (and file (load-source-file file)) '())))
|
(file (assq-ref opts 'file))
|
||||||
(show-what-to-deploy machines)
|
(machines (or (and file (load-source-file file)) '())))
|
||||||
|
(show-what-to-deploy machines)
|
||||||
|
|
||||||
(with-status-verbosity (assoc-ref opts 'verbosity)
|
(with-status-verbosity (assoc-ref opts 'verbosity)
|
||||||
(with-store store
|
(with-store store
|
||||||
(set-build-options-from-command-line store opts)
|
(set-build-options-from-command-line store opts)
|
||||||
(with-build-handler (build-notifier #:use-substitutes?
|
(with-build-handler (build-notifier #:use-substitutes?
|
||||||
(assoc-ref opts 'substitutes?))
|
(assoc-ref opts 'substitutes?))
|
||||||
(parameterize ((%graft? (assq-ref opts 'graft?)))
|
(parameterize ((%graft? (assq-ref opts 'graft?)))
|
||||||
(map/accumulate-builds store
|
(map/accumulate-builds store
|
||||||
(cut deploy-machine* store <>)
|
(cut deploy-machine* store <>)
|
||||||
machines)))))))
|
machines))))))))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue