diff options
author | Christopher Baines <mail@cbaines.net> | 2020-04-08 20:58:12 +0100 |
---|---|---|
committer | Christopher Baines <mail@cbaines.net> | 2020-04-10 20:34:47 +0100 |
commit | 2f9659f82a1bab7f5c006fb1920e9209e9530605 (patch) | |
tree | 1f45cfd186eeb440cb14d5ecfa266d0d7c954bfb /scripts/guix-build-coordinator.in | |
parent | 3bde300af864e892aa84adac17f8d899bc33cae4 (diff) | |
download | build-coordinator-2f9659f82a1bab7f5c006fb1920e9209e9530605.tar build-coordinator-2f9659f82a1bab7f5c006fb1920e9209e9530605.tar.gz |
Call the generic datastore-update method
Rather than running Sqitch for PostgreSQL manually.
Diffstat (limited to 'scripts/guix-build-coordinator.in')
-rw-r--r-- | scripts/guix-build-coordinator.in | 28 |
1 files changed, 4 insertions, 24 deletions
diff --git a/scripts/guix-build-coordinator.in b/scripts/guix-build-coordinator.in index 1336670..9a2d282 100644 --- a/scripts/guix-build-coordinator.in +++ b/scripts/guix-build-coordinator.in @@ -94,32 +94,12 @@ derivation-file))) (simple-format #t "build submitted as ~A\n" uuid)))))) ((arguments ...) - (let ((opts (parse-options arguments))) + (let* ((opts (parse-options arguments)) + (datastore (database-uri->datastore + (assq-ref opts 'database)))) (when (assoc-ref opts 'update-database) - (let ((command - (list (%config 'sqitch) - "deploy" - "--db-client" (%config 'sqitch-psql) - "--chdir" (dirname (%config 'sqitch-plan)) - "--plan-file" (%config 'sqitch-plan) - (string-append "db:pg://" - (%config 'database-user) - "@" - (if (string=? (%config 'database-host) - "localhost") - "" ; This means the unix socket - ; connection will be used - (%config 'database-host)) - "/" - (%config 'database-name))))) - (simple-format #t "running command: ~A\n" - (string-join command)) - (unless (zero? (apply system* command)) - (simple-format - (current-error-port) - "error: sqitch command failed\n") - (exit 1)))) + (datastore-update datastore)) (let ((pid-file (assq-ref opts 'pid-file))) (when pid-file |