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"
|
(:author "Brit Butler"
|
||||||
|
:deploy "/home/git/blog/"
|
||||||
:domain "http://blog.redlinernotes.com"
|
:domain "http://blog.redlinernotes.com"
|
||||||
:license "CC-BY-SA"
|
:license "CC-BY-SA"
|
||||||
:plugins (markdown mathjax)
|
:plugins (mathjax)
|
||||||
:repo "/home/redline/projects/coleslaw/ignore/input/"
|
:repo "/home/git/tmp/improvedmeans/"
|
||||||
:sitenav ""
|
:sitenav ""
|
||||||
:title "Improved Means for Achieving Deteriorated Ends"
|
:title "Improved Means for Achieving Deteriorated Ends"
|
||||||
:theme "hyde")
|
: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,17 +45,19 @@ If RAW is non-nil, write the content without wrapping it in the base template."
|
||||||
(defgeneric deploy (dir)
|
(defgeneric deploy (dir)
|
||||||
(:documentation "Deploy DIR, updating the .prev and .curr symlinks.")
|
(:documentation "Deploy DIR, updating the .prev and .curr symlinks.")
|
||||||
(:method (dir)
|
(:method (dir)
|
||||||
(let ((new-build (app-path "generated/~a" (get-universal-time)))
|
(flet ((deploy-path (path &rest args)
|
||||||
(prev (merge-pathnames ".prev" (deploy *config*)))
|
(merge-pathnames (apply 'format nil path args) (deploy *config*))))
|
||||||
(curr (merge-pathnames ".curr" (deploy *config*))))
|
(let ((new-build (deploy-path "generated/~a" (get-universal-time)))
|
||||||
(ensure-directories-exist new-build)
|
(prev (deploy-path ".prev"))
|
||||||
(with-current-directory coleslaw-conf:*basedir*
|
(curr (deploy-path ".curr")))
|
||||||
(run-program "mv" (mapcar #'namestring (list dir new-build)))
|
(ensure-directories-exist new-build)
|
||||||
(when (probe-file prev)
|
(with-current-directory coleslaw-conf:*basedir*
|
||||||
(delete-directory-and-files (read-symlink prev)))
|
(run-program "mv" (mapcar #'namestring (list dir new-build)))
|
||||||
(when (probe-file curr)
|
(when (probe-file prev)
|
||||||
(update-symlink prev (read-symlink curr)))
|
(delete-directory-and-files (read-symlink prev)))
|
||||||
(update-symlink curr new-build)))))
|
(when (probe-file curr)
|
||||||
|
(update-symlink prev (read-symlink curr)))
|
||||||
|
(update-symlink curr new-build))))))
|
||||||
|
|
||||||
(defun main ()
|
(defun main ()
|
||||||
"Load the user's config, then compile and deploy the blog."
|
"Load the user's config, then compile and deploy the blog."
|
||||||
|
|
Loading…
Add table
Reference in a new issue