diff options
author | Munyoki Kilyungi | 2025-09-17 15:19:05 +0300 |
---|---|---|
committer | Munyoki Kilyungi | 2025-09-19 15:36:06 +0300 |
commit | d926469766678e1d00eeae7be15c63235d93d819 (patch) | |
tree | ff1455102402f2e3a08d1966166566e92b339cae | |
parent | 0843b13b27c6a239aba4a63fc2f46baa9358baaf (diff) | |
download | gn-machines-d926469766678e1d00eeae7be15c63235d93d819.tar.gz |
genenetwork-development: Make gn-docs repository persistent.
Previously, gn-docs at `/export/data/repositories/gn-docs` was deleted and re-cloned on each service start, causing any local edits to be lost; now it is only cloned if missing, making it persistent across restarts so changes can be preserved.
-rw-r--r-- | genenetwork-development.scm | 34 |
1 files changed, 18 insertions, 16 deletions
diff --git a/genenetwork-development.scm b/genenetwork-development.scm index e7edf7b..7ca5d58 100644 --- a/genenetwork-development.scm +++ b/genenetwork-development.scm @@ -738,24 +738,26 @@ server described by CONFIG, a <genenetwork-configuration> object." (setenv "REQUESTS_CA_BUNDLE" (getenv "SSL_CERT_FILE")) (let ((current-repo-path "/export/data/repositories/gn-docs")) - (when (file-exists? current-repo-path) - (delete-file-recursively current-repo-path)) (setenv "CURRENT_REPO_PATH" current-repo-path) (with-directory-excursion - "/export/data/repositories" - (invoke #$(file-append git-minimal "/bin/git") - "clone" "--depth" "1" (getenv "CGIT_REPO_PATH") current-repo-path) - (when (file-exists? "gn-guile") - (delete-file-recursively "gn-guile")) - (invoke "git" "clone" "--depth" "1" "https://git.genenetwork.org/gn-guile") - ;; We have a gn-guile-dev wrapper script that sets a "./" in the - ;; GN_GUILE_LOAD_PATH hence allowing this to be run from the gn-guile - ;; directory. This allows gn-guile to be run from the latest - ;; upstream commits without pinning to guix. - (with-directory-excursion "gn-guile" - (show-head-commit) - (invoke #$(file-append gn-guile "/bin/gn-guile-dev") - (number->string #$gn-guile-port))))))))) + "/export/data/repositories" + ;; All edits go to the current-repo-path; so we need it to + ;; be persistent. + (unless (file-exists? current-repo-path) + (invoke #$(file-append git-minimal "/bin/git") + "clone" "--depth" "1" (getenv "CGIT_REPO_PATH") current-repo-path)) + + (when (file-exists? "gn-guile") + (delete-file-recursively "gn-guile")) + (invoke "git" "clone" "--depth" "1" "https://git.genenetwork.org/gn-guile") + ;; We have a gn-guile-dev wrapper script that sets a "./" in the + ;; GN_GUILE_LOAD_PATH hence allowing this to be run from the gn-guile + ;; directory. This allows gn-guile to be run from the latest + ;; upstream commits without pinning to guix. + (with-directory-excursion "gn-guile" + (show-head-commit) + (invoke #$(file-append gn-guile "/bin/gn-guile-dev") + (number->string #$gn-guile-port))))))))) (define (genenetwork-shepherd-services config) "Return shepherd services to run the genenetwork development server |