mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-11-16 19:57:39 -05: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 @@ (define (guix-deploy . args)
|
|||
(define (handle-argument arg result)
|
||||
(alist-cons 'file arg result))
|
||||
|
||||
(let* ((opts (parse-command-line args %options (list %default-options)
|
||||
#:argument-handler handle-argument))
|
||||
(file (assq-ref opts 'file))
|
||||
(machines (or (and file (load-source-file file)) '())))
|
||||
(show-what-to-deploy machines)
|
||||
(with-error-handling
|
||||
(let* ((opts (parse-command-line args %options (list %default-options)
|
||||
#:argument-handler handle-argument))
|
||||
(file (assq-ref opts 'file))
|
||||
(machines (or (and file (load-source-file file)) '())))
|
||||
(show-what-to-deploy machines)
|
||||
|
||||
(with-status-verbosity (assoc-ref opts 'verbosity)
|
||||
(with-store store
|
||||
(set-build-options-from-command-line store opts)
|
||||
(with-build-handler (build-notifier #:use-substitutes?
|
||||
(assoc-ref opts 'substitutes?))
|
||||
(parameterize ((%graft? (assq-ref opts 'graft?)))
|
||||
(map/accumulate-builds store
|
||||
(cut deploy-machine* store <>)
|
||||
machines)))))))
|
||||
(with-status-verbosity (assoc-ref opts 'verbosity)
|
||||
(with-store store
|
||||
(set-build-options-from-command-line store opts)
|
||||
(with-build-handler (build-notifier #:use-substitutes?
|
||||
(assoc-ref opts 'substitutes?))
|
||||
(parameterize ((%graft? (assq-ref opts 'graft?)))
|
||||
(map/accumulate-builds store
|
||||
(cut deploy-machine* store <>)
|
||||
machines))))))))
|
||||
|
|
Loading…
Reference in a new issue