Add *updated-files* to track files changed in the last push.
This commit is contained in:
parent
35afff4ed9
commit
3088b6de8e
5 changed files with 23 additions and 27 deletions
|
@ -1,7 +1,7 @@
|
||||||
(defsystem #:coleslaw
|
(defsystem #:coleslaw
|
||||||
:name "coleslaw"
|
:name "coleslaw"
|
||||||
:description "Flexible Lisp Blogware"
|
:description "Flexible Lisp Blogware"
|
||||||
:version "0.9.4-dev"
|
:version "0.9.4"
|
||||||
:license "BSD"
|
:license "BSD"
|
||||||
:author "Brit Butler <redline6561@gmail.com>"
|
:author "Brit Butler <redline6561@gmail.com>"
|
||||||
:pathname "src/"
|
:pathname "src/"
|
||||||
|
|
|
@ -240,20 +240,6 @@ avoiding work is better than using more workers. Moreover, being
|
||||||
able to determine (and expose) what files just changed enables new
|
able to determine (and expose) what files just changed enables new
|
||||||
functionality such as plugins that cross-post to tumblr.
|
functionality such as plugins that cross-post to tumblr.
|
||||||
|
|
||||||
Git's post-receive hook is supposed to get a list of refs on $STDIN.
|
|
||||||
A brave soul could update our post-receive script to iterate over
|
|
||||||
those lines as shown in step 3 of this [blog post][post_receive_blog].
|
|
||||||
There would be two primary benefits:
|
|
||||||
|
|
||||||
1. We could pass the oldrev (previous revision) of the blog repo
|
|
||||||
to `coleslaw:main`. That could be used in conjunction with
|
|
||||||
`get-updated-files` to get a list of the files modified in the
|
|
||||||
last push. This would enable cross-posting plugins to be developed
|
|
||||||
as well as opening the door for incremental compilation.
|
|
||||||
2. More seriously, **Coleslaw** currently deploys for _any_ branch
|
|
||||||
pushed to the bare repo. This change would also ensure that we only
|
|
||||||
invoke `coleslaw:main` when a push is made to the master branch.
|
|
||||||
|
|
||||||
This is a cool project and the effects are far reaching. Among other
|
This is a cool project and the effects are far reaching. Among other
|
||||||
things the existing deployment model would not work as it involves
|
things the existing deployment model would not work as it involves
|
||||||
rebuilding the entire site. In all likelihood we would want to update
|
rebuilding the entire site. In all likelihood we would want to update
|
||||||
|
@ -264,7 +250,6 @@ would have to be regenerated along with any tag or month indexes
|
||||||
matching the modified files. If incremental compilation is a goal,
|
matching the modified files. If incremental compilation is a goal,
|
||||||
simply disabling the indexes may be appropriate for certain users.
|
simply disabling the indexes may be appropriate for certain users.
|
||||||
|
|
||||||
[post_receive_blog]: http://codeshal.tumblr.com/post/927943180/git-post-receive-hook-that-submits-code-to-review-board
|
|
||||||
[post_receive_hook]: https://github.com/redline6561/coleslaw/blob/master/examples/example.post-receive
|
[post_receive_hook]: https://github.com/redline6561/coleslaw/blob/master/examples/example.post-receive
|
||||||
[closure_template]: https://github.com/archimag/cl-closure-template
|
[closure_template]: https://github.com/archimag/cl-closure-template
|
||||||
[api_docs]: https://github.com/redline6561/coleslaw/blob/master/docs/plugin-api.md
|
[api_docs]: https://github.com/redline6561/coleslaw/blob/master/docs/plugin-api.md
|
||||||
|
|
|
@ -20,15 +20,19 @@ fi
|
||||||
|
|
||||||
git clone $GIT_REPO $TMP_GIT_CLONE || exit 1
|
git clone $GIT_REPO $TMP_GIT_CLONE || exit 1
|
||||||
|
|
||||||
|
while read oldrev newrev refname; do
|
||||||
|
if [ $refname = "refs/head/master" ]; then
|
||||||
if [ $LISP = sbcl ]; then
|
if [ $LISP = sbcl ]; then
|
||||||
sbcl --eval "(ql:quickload 'coleslaw)" \
|
sbcl --eval "(ql:quickload 'coleslaw)" \
|
||||||
--eval "(coleslaw:main \"$TMP_GIT_CLONE\")" \
|
--eval "(coleslaw:main \"$TMP_GIT_CLONE\" \"$oldrev\")" \
|
||||||
--eval "(coleslaw::exit)"
|
--eval "(coleslaw::exit)"
|
||||||
elif [ $LISP = ccl ]; then
|
elif [ $LISP = ccl ]; then
|
||||||
echo "(ql:quickload 'coleslaw)(coleslaw:main \"$TMP_GIT_CLONE\")(coleslaw::exit)" | ccl -b
|
ccl -e "(ql:quickload 'coleslaw) (coleslaw:main \"$TMP_GIT_CLONE\" \"$oldrev\") (coleslaw::exit)"
|
||||||
else
|
else
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
rm -rf $TMP_GIT_CLONE
|
rm -rf $TMP_GIT_CLONE
|
||||||
exit
|
exit
|
||||||
|
|
|
@ -1,7 +1,13 @@
|
||||||
(in-package :coleslaw)
|
(in-package :coleslaw)
|
||||||
|
|
||||||
(defun main (&optional (repo-dir ""))
|
(defvar *updated-files* nil
|
||||||
"Load the user's config file, then compile and deploy the site."
|
"A plist of (file-status file-name) for files changed on the last git push.")
|
||||||
|
|
||||||
|
(defun main (&optional (repo-dir "") oldrev)
|
||||||
|
"Load the user's config file, then compile and deploy the site. Optionally,
|
||||||
|
REPO-DIR is the location of the blog repo and OLDREV is the revision prior to
|
||||||
|
the last push."
|
||||||
|
(setf *updated-files* oldrev)
|
||||||
(load-config repo-dir)
|
(load-config repo-dir)
|
||||||
(load-content)
|
(load-content)
|
||||||
(compile-theme (theme *config*))
|
(compile-theme (theme *config*))
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
(:export #:main
|
(:export #:main
|
||||||
#:preview
|
#:preview
|
||||||
#:*config*
|
#:*config*
|
||||||
|
#:*updated-files*
|
||||||
#:content
|
#:content
|
||||||
#:post
|
#:post
|
||||||
#:index
|
#:index
|
||||||
|
|
Loading…
Add table
Reference in a new issue