Skip to content
Snippets Groups Projects
Unverified Commit c9c8c633 authored by Ludovic Courtès's avatar Ludovic Courtès
Browse files

deploy: Gracefully handle errors.

* guix/scripts/deploy.scm (guix-deploy): Wrap body in 'with-error-handling'.
parent cfd8daaf
No related branches found
No related tags found
No related merge requests found
...@@ -140,18 +140,19 @@ (define (guix-deploy . args) ...@@ -140,18 +140,19 @@ (define (guix-deploy . args)
(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-store store (with-status-verbosity (assoc-ref opts 'verbosity)
(set-build-options-from-command-line store opts) (with-store store
(with-build-handler (build-notifier #:use-substitutes? (set-build-options-from-command-line store opts)
(assoc-ref opts 'substitutes?)) (with-build-handler (build-notifier #:use-substitutes?
(parameterize ((%graft? (assq-ref opts 'graft?))) (assoc-ref opts 'substitutes?))
(map/accumulate-builds store (parameterize ((%graft? (assq-ref opts 'graft?)))
(cut deploy-machine* store <>) (map/accumulate-builds store
machines))))))) (cut deploy-machine* store <>)
machines))))))))
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment