-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
131 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
ARG LISP=sbcl | ||
ARG LISP_VERSION=2.2.4 | ||
|
||
FROM clfoundation/${LISP}:${LISP_VERSION} as base | ||
|
||
RUN mkdir /breeze | ||
WORKDIR /breeze | ||
|
||
|
||
FROM base as quicklisp | ||
|
||
RUN QUICKLISP_DIST_VERSION=latest QUICKLISP_ADD_TO_INIT_FILE=true /usr/local/bin/install-quicklisp | ||
|
||
|
||
FROM quicklisp as deps | ||
|
||
COPY breeze.asd . | ||
COPY scripts/load-dependencies.lisp scripts/load-dependencies.lisp | ||
|
||
RUN sbcl --noinform --non-interactive \ | ||
--load scripts/load-dependencies.lisp | ||
|
||
|
||
FROM scratch as dependencies.core | ||
|
||
COPY --from=deps /breeze/dependencies.core /dependencies.core | ||
|
||
|
||
FROM base as doc | ||
|
||
COPY . . | ||
RUN sbcl --core dependencies.core \ | ||
--eval "(asdf:load-system '#:breeze/doc)" \ | ||
--eval '(breeze.documentation::generate-documentation)' | ||
|
||
FROM alpine:3.18.4 as org-publish | ||
|
||
RUN mkdir /breeze | ||
WORKDIR /breeze | ||
|
||
RUN apk add bash ca-certificates emacs | ||
|
||
COPY . . | ||
COPY --from=doc /breeze/public /breeze/public | ||
|
||
# RUN DEBIAN_FRONTEND=noninteractive apt update && apt install -yq emacs | ||
RUN emacs -Q --batch --load scripts/org-publish-project.el --kill | ||
RUN ls | ||
RUN ls /breeze/public | ||
|
||
|
||
FROM scratch as public | ||
|
||
COPY --from=org-publish /breeze/public / |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
(cl:in-package #:cl-user) | ||
|
||
(require '#:asdf) | ||
|
||
#-quicklisp | ||
(let ((quicklisp-init #P"/opt/quicklisp/setup.lisp")) | ||
(when (probe-file quicklisp-init) | ||
(load quicklisp-init))) | ||
|
||
(asdf:load-asd | ||
(merge-pathnames "../breeze.asd" *load-truename*)) | ||
|
||
(flet ((find-all-related-systems (system) | ||
"Given a system, find all systems defined in the same system definition | ||
file (including the one passed as argument)." | ||
(let ((result ()) | ||
(asd-pathname (asdf:system-source-file system))) | ||
(asdf:map-systems (lambda (system) | ||
;; TODO Perhaps use asdf:primary-system-name | ||
(when (equal asd-pathname | ||
(asdf:system-source-file system)) | ||
(push system result)))) | ||
result))) | ||
(let* ((systems (find-all-related-systems "breeze")) | ||
(dependencies (remove-if (lambda (system-name) | ||
(uiop:string-prefix-p "breeze" system-name)) | ||
(loop | ||
:for system-name :in systems | ||
:for system = (asdf:find-system system-name) | ||
:for dependecy-list = (asdf:system-depends-on system) | ||
:append (copy-list dependecy-list))))) | ||
(ql:quickload dependencies) | ||
(mapcar #'asdf:register-immutable-system dependencies))) | ||
|
||
(uiop:dump-image "dependencies.core") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
|
||
(message "Installing packages (from ELPA)") | ||
|
||
(package-initialize) | ||
(setf package-selected-packages | ||
'(htmlize)) | ||
(package-install-selected-packages t) | ||
|
||
|
||
(message "Publishing...") | ||
|
||
(require 'org) | ||
(require 'org-id) | ||
(require 'htmlize) | ||
|
||
|
||
|
||
;; See (describe-variable 'org-publish-project-alist) | ||
|
||
(let* ((forcep t) ; "forcep" is for interactive sessions. | ||
(org-id-link-to-org-use-id t) | ||
(default-directory | ||
(expand-file-name | ||
(concat | ||
(file-name-directory (or load-file-name buffer-file-name)) | ||
".."))) | ||
(root "docs") | ||
(project-alist | ||
`("breeze" | ||
:base-directory ,root | ||
:publishing-function org-html-publish-to-html | ||
:publishing-directory "./public" | ||
|
||
:author "Francis St-Amour" | ||
:creator "Francis St-Amour" | ||
|
||
:auto-sitemap t | ||
;; :makeindex t | ||
:with-toc nil | ||
))) | ||
(org-id-update-id-locations (directory-files root t "\\.org$")) | ||
(org-publish project-alist forcep)) |