guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

01/01: hydra: Create a website module.


From: Mathieu Othacehe
Subject: 01/01: hydra: Create a website module.
Date: Tue, 21 Dec 2021 06:05:20 -0500 (EST)

mothacehe pushed a commit to branch wip-website
in repository maintenance.

commit 85524046b5d18def0d0d4f933415997a6bae345f
Author: Mathieu Othacehe <othacehe@gnu.org>
AuthorDate: Tue Dec 21 11:54:12 2021 +0100

    hydra: Create a website module.
    
    Factorize website services in a single (website) module so that they can be
    hosted by multiple nodes for redundancy.
    
    * hydra/website.scm: New file.
    * hydra/berlin.scm: Use it.
---
 hydra/berlin.scm  | 87 +++++++++----------------------------------------------
 hydra/website.scm | 65 +++++++++++++++++++++++++++++++++++++++++
 2 files changed, 79 insertions(+), 73 deletions(-)

diff --git a/hydra/berlin.scm b/hydra/berlin.scm
index 011088c..d1c8f85 100644
--- a/hydra/berlin.scm
+++ b/hydra/berlin.scm
@@ -63,6 +63,7 @@
                   (ssh-public-key (local-file "keys/ssh/maxim.pub")))))
 
 (include "nginx/berlin.scm")
+(include "website.scm")
 
 
 ;;;
@@ -302,68 +303,6 @@ Happy hacking!\n"))
 
              (service nginx-service-type %nginx-configuration)
 
-             ;; Runnning guix.gnu.org.
-             (service static-web-site-service-type
-                      (static-web-site-configuration
-                       (git-url
-                        
"https://git.savannah.gnu.org/git/guix/guix-artwork.git";)
-                       (directory "/srv/guix.gnu.org")
-                       (build-file "website/.guix.scm")))
-
-             ;; Manual for the latest stable release.
-             (service static-web-site-service-type
-                      (static-web-site-configuration
-                       (git-url "https://git.savannah.gnu.org/git/guix.git";)
-                       (git-ref '(branch . "version-1.3.0"))
-                       (period (* 24 3600))       ;check once per day
-                       (directory "/srv/guix-manual")
-                       (build-file "doc/build.scm")
-                       (environment-variables
-                         '(("GUIX_MANUAL_VERSION" . "1.3.0")
-                           ("GUIX_WEB_SITE_URL" . "/")))))
-
-             ;; Manual for 'master'.
-             (service static-web-site-service-type
-                      (static-web-site-configuration
-                       (git-url "https://git.savannah.gnu.org/git/guix.git";)
-                       (directory "/srv/guix-manual-devel")
-
-                       ;; 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" . "/")))))
-
-             ;; Cookbook for 'master'.
-             (service static-web-site-service-type
-                      (static-web-site-configuration
-                       (git-url "https://git.savannah.gnu.org/git/guix.git";)
-                       (directory "/srv/guix-cookbook")
-
-                       ;; XXX: Use a different cache directory (see above).
-                       (cache-directory "guix-cookbook-master")
-
-                       (build-file "doc/build.scm")
-                       (environment-variables
-                        '(("GUIX_MANUAL" . "guix-cookbook")
-                          ("GUIX_WEB_SITE_URL" . "/")))))
-
-             ;; The bootstrappable.org web site.
-             (service static-web-site-service-type
-                      (static-web-site-configuration
-                       (git-url
-                        
"https://git.savannah.gnu.org/git/guix/bootstrappable.git";)
-                       (period (* 24 3600))       ;check once per day
-                       (directory "/srv/bootstrappable.org")))
-
-             ;; GWL web site.
-             (service gwl-web-service-type)
              (service mumi-service-type
                       (mumi-configuration
                        ;; XXX Please do not re-enable the mailer lightly.  
We've
@@ -419,14 +358,16 @@ Happy hacking!\n"))
                           (public-key 
"jYP2hpbvUlklLamTWCSMW00xyneBrqazBI/ldiINOWc=")
                           (allowed-ips '("10.0.0.10/32")))))))
 
-             (frontend-services %sysadmins
-                                ;; Make sure we get enough build users.
-                                #:authorized-keys %build-node-keys
-                                #:build-accounts-to-max-jobs-ratio 5
-                                #:gc-threshold (* 15 TiB)
-                                #:systems '("x86_64-linux" "i686-linux"
-                                            "aarch64-linux"
-                                            "powerpc64le-linux")
-                                #:motd %motd
-                                #:publish-workers 8
-                                #:max-jobs 20))))
+             (append
+              (website-services)
+              (frontend-services %sysadmins
+                                 ;; Make sure we get enough build users.
+                                 #:authorized-keys %build-node-keys
+                                 #:build-accounts-to-max-jobs-ratio 5
+                                 #:gc-threshold (* 15 TiB)
+                                 #:systems '("x86_64-linux" "i686-linux"
+                                             "aarch64-linux"
+                                             "powerpc64le-linux")
+                                 #:motd %motd
+                                 #:publish-workers 8
+                                 #:max-jobs 20)))))
diff --git a/hydra/website.scm b/hydra/website.scm
new file mode 100644
index 0000000..51136b8
--- /dev/null
+++ b/hydra/website.scm
@@ -0,0 +1,65 @@
+(define (website-services)
+  "Return the list of Guix website services."
+  (list
+   ;; Runnning guix.gnu.org.
+   (service static-web-site-service-type
+            (static-web-site-configuration
+             (git-url
+              "https://git.savannah.gnu.org/git/guix/guix-artwork.git";)
+             (directory "/srv/guix.gnu.org")
+             (build-file "website/.guix.scm")))
+
+   ;; Manual for the latest stable release.
+   (service static-web-site-service-type
+            (static-web-site-configuration
+             (git-url "https://git.savannah.gnu.org/git/guix.git";)
+             (git-ref '(branch . "version-1.3.0"))
+             (period (* 24 3600))       ;check once per day
+             (directory "/srv/guix-manual")
+             (build-file "doc/build.scm")
+             (environment-variables
+              '(("GUIX_MANUAL_VERSION" . "1.3.0")
+                ("GUIX_WEB_SITE_URL" . "/")))))
+
+   ;; Manual for 'master'.
+   (service static-web-site-service-type
+            (static-web-site-configuration
+             (git-url "https://git.savannah.gnu.org/git/guix.git";)
+             (directory "/srv/guix-manual-devel")
+
+             ;; 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" . "/")))))
+
+   ;; Cookbook for 'master'.
+   (service static-web-site-service-type
+            (static-web-site-configuration
+             (git-url "https://git.savannah.gnu.org/git/guix.git";)
+             (directory "/srv/guix-cookbook")
+
+             ;; XXX: Use a different cache directory (see above).
+             (cache-directory "guix-cookbook-master")
+
+             (build-file "doc/build.scm")
+             (environment-variables
+              '(("GUIX_MANUAL" . "guix-cookbook")
+                ("GUIX_WEB_SITE_URL" . "/")))))
+
+   ;; The bootstrappable.org web site.
+   (service static-web-site-service-type
+            (static-web-site-configuration
+             (git-url
+              "https://git.savannah.gnu.org/git/guix/bootstrappable.git";)
+             (period (* 24 3600))       ;check once per day
+             (directory "/srv/bootstrappable.org")))
+
+   ;; GWL web site.
+   (service gwl-web-service-type)))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]