mirror of
https://git.savannah.gnu.org/git/guix.git
synced 2025-01-20 14:47:20 +01:00
deploy: Use 'with-build-handler'.
Until now, 'guix deploy' would never display what is going to be built. * guix/scripts/deploy.scm (guix-deploy): Wrap 'for-each' in 'with-build-handler'.
This commit is contained in:
parent
62195b9a8f
commit
bdda46a67d
1 changed files with 18 additions and 16 deletions
|
@ -108,19 +108,21 @@ (define (handle-argument arg result)
|
|||
(with-status-verbosity (assoc-ref opts 'verbosity)
|
||||
(with-store store
|
||||
(set-build-options-from-command-line store opts)
|
||||
(for-each (lambda (machine)
|
||||
(info (G_ "deploying to ~a...~%")
|
||||
(machine-display-name machine))
|
||||
(parameterize ((%graft? (assq-ref opts 'graft?)))
|
||||
(guard (c ((message-condition? c)
|
||||
(report-error (G_ "failed to deploy ~a: ~a~%")
|
||||
(machine-display-name machine)
|
||||
(condition-message c)))
|
||||
((deploy-error? c)
|
||||
(when (deploy-error-should-roll-back c)
|
||||
(info (G_ "rolling back ~a...~%")
|
||||
(machine-display-name machine))
|
||||
(run-with-store store (roll-back-machine machine)))
|
||||
(apply throw (deploy-error-captured-args c))))
|
||||
(run-with-store store (deploy-machine machine)))))
|
||||
machines)))))
|
||||
(with-build-handler (build-notifier #:use-substitutes?
|
||||
(assoc-ref opts 'substitutes?))
|
||||
(for-each (lambda (machine)
|
||||
(info (G_ "deploying to ~a...~%")
|
||||
(machine-display-name machine))
|
||||
(parameterize ((%graft? (assq-ref opts 'graft?)))
|
||||
(guard (c ((message-condition? c)
|
||||
(report-error (G_ "failed to deploy ~a: ~a~%")
|
||||
(machine-display-name machine)
|
||||
(condition-message c)))
|
||||
((deploy-error? c)
|
||||
(when (deploy-error-should-roll-back c)
|
||||
(info (G_ "rolling back ~a...~%")
|
||||
(machine-display-name machine))
|
||||
(run-with-store store (roll-back-machine machine)))
|
||||
(apply throw (deploy-error-captured-args c))))
|
||||
(run-with-store store (deploy-machine machine)))))
|
||||
machines))))))
|
||||
|
|
Loading…
Reference in a new issue