Преглед изворни кода

first pass in adding github integration

Do Nhat Minh пре 12 година
родитељ
комит
6396e136d3
2 измењених фајлова са 10 додато и 0 уклоњено
  1. 9 0
      src/coleslaw.lisp
  2. 1 0
      src/config.lisp

+ 9 - 0
src/coleslaw.lisp

@@ -63,6 +63,15 @@ Additional args to render CONTENT can be passed via RENDER-ARGS."
63 63
            (curr (rel-path dest ".curr")))
64 64
       (ensure-directories-exist new-build)
65 65
       (run-program "mv ~a ~a" staging new-build)
66
+      (when (github *config*)
67
+        (let ((cname-filename (rel-path "" "~a/CNAME" new-build))
68
+              (stripped-url (subseq (domain *config*)
69
+                                    (+ 2 (position #\/ (domain *config*))))))
70
+          (format t "~a" cname-filename)
71
+          (with-open-file (cname cname-filename
72
+                                 :direction :output
73
+                                 :if-exists :supersede)
74
+                          (format cname "~a~%" stripped-url))))
66 75
       (when (probe-file prev)
67 76
         (delete-directory-and-files (truename prev) :if-does-not-exist :ignore))
68 77
       (when (probe-file curr)

+ 1 - 0
src/config.lisp

@@ -5,6 +5,7 @@
5 5
    (deploy :initarg :deploy :initform nil :accessor deploy)
6 6
    (domain :initarg :domain :initform "" :accessor domain)
7 7
    (feeds :initarg :feeds :initform nil :accessor feeds)
8
+   (github :initarg :github :initform nil :accessor github)
8 9
    (license :initarg :license :initform nil :accessor license)
9 10
    (plugins :initarg :plugins :initform nil :accessor plugins)
10 11
    (repo :initarg :repo :initform #p"/" :accessor repo)