瀏覽代碼

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
            (curr (rel-path dest ".curr")))
63
            (curr (rel-path dest ".curr")))
64
       (ensure-directories-exist new-build)
64
       (ensure-directories-exist new-build)
65
       (run-program "mv ~a ~a" staging new-build)
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
       (when (probe-file prev)
75
       (when (probe-file prev)
67
         (delete-directory-and-files (truename prev) :if-does-not-exist :ignore))
76
         (delete-directory-and-files (truename prev) :if-does-not-exist :ignore))
68
       (when (probe-file curr)
77
       (when (probe-file curr)

+ 1 - 0
src/config.lisp

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