aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2020-09-18 11:15:13 +0100
committerChristopher Baines <mail@cbaines.net>2020-09-18 11:15:39 +0100
commit6696aa58eeb147d46636d656d9960620d74cecd8 (patch)
tree054afd4231fcc6d7a58dbc0550217020cd89ddda /scripts
parentc0012d4b2fa4c008ead19ec100cd182ff95eb356 (diff)
downloadbuild-coordinator-6696aa58eeb147d46636d656d9960620d74cecd8.tar
build-coordinator-6696aa58eeb147d46636d656d9960620d74cecd8.tar.gz
Make the coordinator an argument in the queue builds script
Diffstat (limited to 'scripts')
-rw-r--r--scripts/guix-build-coordinator-queue-builds-from-guix-data-service.in26
1 files changed, 18 insertions, 8 deletions
diff --git a/scripts/guix-build-coordinator-queue-builds-from-guix-data-service.in b/scripts/guix-build-coordinator-queue-builds-from-guix-data-service.in
index 3bfc451..bb8627f 100644
--- a/scripts/guix-build-coordinator-queue-builds-from-guix-data-service.in
+++ b/scripts/guix-build-coordinator-queue-builds-from-guix-data-service.in
@@ -131,12 +131,12 @@
#t))
derivations))
-(define* (submit-build derivation #:key (priority 0))
+(define* (submit-build coordinator derivation #:key (priority 0))
(retry-on-error
(lambda ()
(let ((response
(send-submit-build-request
- "http://127.0.0.1:8746"
+ coordinator
derivation
(list
(string-append "https://" %guix-data-service-host))
@@ -158,13 +158,13 @@
#:times 30
#:delay 30))
-(define (submit-builds-for-revision commit systems-and-targets)
+(define (submit-builds-for-revision coordinator commit systems-and-targets)
(simple-format #t "looking at revision ~A\n" commit)
(for-each
(match-lambda
((system . target)
(for-each (lambda (derivation)
- (submit-build derivation #:priority 1000))
+ (submit-build coordinator derivation #:priority 1000))
(channel-instance-derivations-for-commit commit system))
(let ((unprocessed-package-derivations
@@ -174,7 +174,9 @@
#:system system
#:target target))))
- (for-each submit-build unprocessed-package-derivations)
+ (for-each (lambda (derivation)
+ (submit-build coordinator derivation))
+ unprocessed-package-derivations)
(record-derivations-as-processed unprocessed-package-derivations))))
systems-and-targets))
@@ -192,10 +194,16 @@
((system target)
`((,system . ,target)
,@(or (assq-ref result 'systems-and-targets) '()))))
- (alist-delete 'systems-and-targets result))))))
+ (alist-delete 'systems-and-targets result))))
+ (option '("coordinator") #t #f
+ (lambda (opt name arg result)
+ (alist-cons 'coordinator
+ arg
+ (alist-delete 'coordinator result))))))
+
(define %option-defaults
- '())
+ '((coordinator . "http://127.0.0.1:8746")))
(define (parse-options options defaults args)
(args-fold
@@ -225,7 +233,9 @@
(while #t
(for-each (lambda (commit)
- (submit-builds-for-revision commit systems-and-targets)
+ (submit-builds-for-revision (assq-ref opts 'coordinator)
+ commit
+ systems-and-targets)
(record-revision-as-processed commit))
(unseen-revisions))