plugins/gh-pages.lisp (1302 bytes)
1 (eval-when (:compile-toplevel :load-toplevel) 2 (ql:quickload 'puri :silent t)) 3 (defpackage :coleslaw-gh-pages 4 (:use :cl) 5 (:import-from :coleslaw 6 #:*config* 7 #:domain 8 #:deploy 9 #:staging-dir 10 #:deploy-dir) 11 (:export #:enable)) 12 13 (in-package :coleslaw-gh-pages) 14 15 (defvar *options* nil) 16 17 (defmethod deploy (staging) 18 (uiop:run-program (list* (namestring 19 (merge-pathnames "plugins/publish-gh-pages.sh" 20 coleslaw-conf:*basedir*)) 21 (namestring 22 (merge-pathnames (staging-dir *config*))) 23 (namestring 24 (merge-pathnames (deploy-dir *config*))) 25 *options*) 26 :output t 27 :error-output t)) 28 29 (defun enable (&key url (branch "gh-pages") (remote "origin") cname) 30 (check-type url string) 31 (check-type remote string) 32 (check-type branch string) 33 (if (eq t cname) 34 (progn 35 (setf cname (puri:uri-host (puri:parse-uri (domain *config*)))) 36 (check-type cname string) 37 (setf *options* (list url branch remote cname))) 38 (setf *options* (list url branch remote))))