-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstartup.lisp
33 lines (28 loc) · 1.31 KB
/
startup.lisp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
(defun env-value (setting)
"Returns the value of the supplied environment variable."
(sb-ext:posix-getenv (string-upcase (string setting))))
(defun feature-setting-p (setting)
"Returns non-nil iff the setting is enabled."
(let ((value (env-value (concatenate 'string "HAS_" (string-upcase (string setting))))))
(and value (not (equal value "")))))
(format t "~& >> docker setting up environment ... ~%")
(push :docker *features*)
(push #p"/app/" ql:*local-project-directories*)
(format t "~& >> docker finished setting up environment~%")
;;; do we have base systems to load?
(format t "~& >> docker loading base systems ... ~%")
(ql:quickload :split-sequence)
(when (env-value :systems)
(let ((systems (split-sequence:split-sequence #\Space (env-value :systems))))
(ql:quickload systems)))
(format t "~& >> docker finished loading base systems ~%")
;;; do we have a bootable system and package?
(format t "~& >> docker loading boot ... ~%")
(when (env-value :boot)
(let ((name (string-upcase (env-value :boot))))
(ql:quickload name)
(funcall (find-symbol "BOOT" name))))
(format t "~& >> docker finished loading boot ~%")
(eval (read-from-string "(ql:register-local-projects)"))
(eval (read-from-string "(ql:quickload :resources-generator)"))
(eval (read-from-string "(resources-generator:generate-resources)"))