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)
|
||||
(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))))))))
|
||||
|
|
Reference in a new issue