Closed sirherrbatka closed 2 years ago
I'm confused. Should it or should it not connect to the DB during build?
Should not. Pardon my mistake in the issue title.
Ok. I suppose instead of the boot shortcut it'll have to manually load interfaces and :startup
modules.
Would simply disabling the startup hook during build would suffice as a workaround?
Maybe, but it sounds like a pretty bad hack.
Regrettably, I don't understand the inner workings of radiance well enough to create a decent merge request :(
Try this patch
From b495b37808bd66ed80616569eb8f1290f105a61b Mon Sep 17 00:00:00 2001
From: Shinmera <shinmera@tymoon.eu>
Date: Thu, 26 May 2022 14:28:53 +0200
Subject: [PATCH] Simulate boot in deploy.
---
deploy.lisp | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/deploy.lisp b/deploy.lisp
index 446a0cb..fd38c2d 100644
--- a/deploy.lisp
+++ b/deploy.lisp
@@ -18,9 +18,15 @@
(when (boundp 'cl-user::modules)
(dolist (module (symbol-value 'cl-user::modules))
(asdf:load-system module)))
- (deploy:status 1 "Performing boot to load required interfaces")
- (radiance:startup)
- (radiance:shutdown)
+ (deploy:status 1 "Simulating boot to load required interfaces")
+
+ (setf (environment) (or *environment* "default"))
+ (load-implementation 'logger)
+ (load-implementation 'server)
+ (dolist (module (config :startup))
+ #+quicklisp (ql:quickload module)
+ #-quicklisp (asdf:load-system module))
+
;; Clear ASDF/QL
(mapc #'asdf:register-immutable-system (asdf:already-loaded-systems))
(asdf:clear-source-registry)
--
2.36.1
Yeah, this seems to work fine. Line (setf (environment) environment) is not required as far as I can tell.
Do you plan to put this patch on the upstream?
Just did in a723783
Great! Thanks for your help.
My issue is this bit:
This essentially requires having a functional and accessible database during build time. It is a problem when constructing a CI pipeline as it makes the build phase not well separated from the deploy.