[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
02/02: hydra: web: Do not capture (%repository-cache-directory) at build
From: |
Ludovic Courtès |
Subject: |
02/02: hydra: web: Do not capture (%repository-cache-directory) at build time. |
Date: |
Mon, 26 Aug 2019 17:31:31 -0400 (EDT) |
civodul pushed a commit to branch master
in repository maintenance.
commit 8c5258c72f277c3c8d3ce3a5950a5da66852b770
Author: Ludovic Courtès <address@hidden>
Date: Mon Aug 26 23:28:11 2019 +0200
hydra: web: Do not capture (%repository-cache-directory) at build time.
This is a followup to af97a34c500e44ec278caae37656e7e4252df691.
Previously we were capturing (%repository-cache-directory) upon 'guix
system reconfigure', meaning it was always "/root/.cache/…".
* hydra/modules/sysadmin/web.scm (build-program)[build]: When
CACHE-DIRECTORY is true, prepend (%repository-cache-directory).
* hydra/berlin.scm: Remove 'cache-directory' field for
"/srv/guix-manual". Change the 'cache-directory' field of
"/srv/guix-manual-devel" to a relative file name.
---
hydra/berlin.scm | 15 ++++++++++-----
hydra/modules/sysadmin/web.scm | 15 +++++++++++----
2 files changed, 21 insertions(+), 9 deletions(-)
diff --git a/hydra/berlin.scm b/hydra/berlin.scm
index 52d338a..ae86b0a 100644
--- a/hydra/berlin.scm
+++ b/hydra/berlin.scm
@@ -2,7 +2,7 @@
;; hosted at the MDC.
(use-modules (gnu) (guix) (sysadmin services) (sysadmin people) (sysadmin dns)
- (sysadmin web) (guix git))
+ (sysadmin web))
(use-service-modules base databases dns monitoring networking admin shepherd)
(use-package-modules admin certs emacs linux monitoring
ssh tls vim package-management
@@ -223,8 +223,6 @@ fastcgi_param PHP_VALUE \"post_max_size = 16M
(git-ref '(branch . "version-1.0.1"))
(directory "/srv/guix-manual")
(build-file "doc/build.scm")
- (cache-directory (string-append
%repository-cache-directory
- "/guix-stable-manual"))
(environment-variables
'(("GUIX_MANUAL_VERSION" . "1.0.1")
("GUIX_WEB_SITE_URL" . "/")))))
@@ -234,8 +232,15 @@ fastcgi_param PHP_VALUE \"post_max_size = 16M
(static-web-site-configuration
(git-url "https://git.savannah.gnu.org/git/guix.git")
(directory "/srv/guix-manual-devel")
- (cache-directory (string-append
%repository-cache-directory
- "/guix-master-manual"))
+
+ ;; XXX: Use a different cache directory to work around
+ ;; the fact that (guix git) would use a same-named
+ ;; checkout directory for 'master' and for the branch
+ ;; above. Since both mcron jobs run at the same time,
+ ;; they would end up using one branch or the other, in
+ ;; a non-deterministic way.
+ (cache-directory "guix-master-manual")
+
(build-file "doc/build.scm")
(environment-variables
'(("GUIX_WEB_SITE_URL" . "/")))))
diff --git a/hydra/modules/sysadmin/web.scm b/hydra/modules/sysadmin/web.scm
index 2a868ba..89753f8 100644
--- a/hydra/modules/sysadmin/web.scm
+++ b/hydra/modules/sysadmin/web.scm
@@ -67,11 +67,18 @@ that's built with Haunt or similar."
(rename-file pivot root)
(return #t))))
+ (define cache
+ (and=> #$cache-directory
+ (lambda (directory)
+ ;; Interpret DIRECTORY as relative to $HOME/.cache.
+ (string-append (%repository-cache-directory)
+ "/" directory))))
+
(define-values (checkout commit)
- (update-cached-checkout #$url #:ref '#$ref
- #$@(if cache-directory
- `(#:cache-directory
,cache-directory)
- '())))
+ (apply update-cached-checkout #$url #:ref '#$ref
+ (if cache
+ `(#:cache-directory ,cache)
+ '())))
(define obj
(let ((variables '#$environment-variables))