summaryrefslogtreecommitdiff
path: root/guix/scripts/deploy.scm
diff options
context:
space:
mode:
Diffstat (limited to 'guix/scripts/deploy.scm')
-rw-r--r--guix/scripts/deploy.scm25
1 files changed, 17 insertions, 8 deletions
diff --git a/guix/scripts/deploy.scm b/guix/scripts/deploy.scm
index ebc99e52cc..6a67985c8b 100644
--- a/guix/scripts/deploy.scm
+++ b/guix/scripts/deploy.scm
@@ -28,6 +28,8 @@
#:use-module (guix grafts)
#:use-module (ice-9 format)
#:use-module (srfi srfi-1)
+ #:use-module (srfi srfi-34)
+ #:use-module (srfi srfi-35)
#:use-module (srfi srfi-37)
#:export (guix-deploy))
@@ -43,8 +45,6 @@
(define (show-help)
(display (G_ "Usage: guix deploy [OPTION] FILE...
Perform the deployment specified by FILE.\n"))
- (display (G_ "
- -s, --system=SYSTEM attempt to build for SYSTEM--e.g., \"i686-linux\""))
(show-build-options-help)
(newline)
(display (G_ "
@@ -66,8 +66,7 @@ Perform the deployment specified by FILE.\n"))
%standard-build-options))
(define %default-options
- `((system . ,(%current-system))
- (substitutes? . #t)
+ `((substitutes? . #t)
(build-hook? . #t)
(graft? . #t)
(debug . 0)
@@ -91,8 +90,18 @@ Perform the deployment specified by FILE.\n"))
(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 ((%current-system (assq-ref opts 'system))
- (%graft? (assq-ref opts 'graft?)))
- (run-with-store store (deploy-machine 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))))