Tweak deploy code since post-receive kills $TMP_CLONE_REPO.
This commit is contained in:
parent
50f084d7c8
commit
0be1db7890
3 changed files with 24 additions and 13 deletions
|
@ -1,8 +1,9 @@
|
|||
(:author "Brit Butler"
|
||||
:deploy "/home/git/blog/"
|
||||
:domain "http://blog.redlinernotes.com"
|
||||
:license "CC-BY-SA"
|
||||
:plugins (markdown mathjax)
|
||||
:repo "/home/redline/projects/coleslaw/ignore/input/"
|
||||
:plugins (mathjax)
|
||||
:repo "/home/git/tmp/improvedmeans/"
|
||||
:sitenav ""
|
||||
:title "Improved Means for Achieving Deteriorated Ends"
|
||||
:theme "hyde")
|
||||
|
|
8
example.post-receive
Normal file
8
example.post-receive
Normal file
|
@ -0,0 +1,8 @@
|
|||
GIT_REPO=$HOME/improvedmeans.git
|
||||
# TMP_GIT_CLONE _must_ match the :repo arg in coleslawrc excluding trailing slash
|
||||
TMP_GIT_CLONE=$HOME/tmp/improvedmeans
|
||||
|
||||
git clone $GIT_REPO $TMP_GIT_CLONE
|
||||
sbcl --eval "(progn (ql:quickload 'coleslaw) (coleslaw:main) (sb-ext:quit))"
|
||||
rm -Rf $TMP_GIT_CLONE
|
||||
exit
|
|
@ -45,9 +45,11 @@ If RAW is non-nil, write the content without wrapping it in the base template."
|
|||
(defgeneric deploy (dir)
|
||||
(:documentation "Deploy DIR, updating the .prev and .curr symlinks.")
|
||||
(:method (dir)
|
||||
(let ((new-build (app-path "generated/~a" (get-universal-time)))
|
||||
(prev (merge-pathnames ".prev" (deploy *config*)))
|
||||
(curr (merge-pathnames ".curr" (deploy *config*))))
|
||||
(flet ((deploy-path (path &rest args)
|
||||
(merge-pathnames (apply 'format nil path args) (deploy *config*))))
|
||||
(let ((new-build (deploy-path "generated/~a" (get-universal-time)))
|
||||
(prev (deploy-path ".prev"))
|
||||
(curr (deploy-path ".curr")))
|
||||
(ensure-directories-exist new-build)
|
||||
(with-current-directory coleslaw-conf:*basedir*
|
||||
(run-program "mv" (mapcar #'namestring (list dir new-build)))
|
||||
|
@ -55,7 +57,7 @@ If RAW is non-nil, write the content without wrapping it in the base template."
|
|||
(delete-directory-and-files (read-symlink prev)))
|
||||
(when (probe-file curr)
|
||||
(update-symlink prev (read-symlink curr)))
|
||||
(update-symlink curr new-build)))))
|
||||
(update-symlink curr new-build))))))
|
||||
|
||||
(defun main ()
|
||||
"Load the user's config, then compile and deploy the blog."
|
||||
|
|
Loading…
Add table
Reference in a new issue