Minor deploy cleanup.
This commit is contained in:
parent
f6e78dd47c
commit
3a5d2d1c68
2 changed files with 12 additions and 15 deletions
|
@ -57,21 +57,17 @@ Additional args to render CONTENT can be passed via RENDER-ARGS."
|
||||||
(defgeneric deploy (staging)
|
(defgeneric deploy (staging)
|
||||||
(:documentation "Deploy the STAGING dir, updating the .prev and .curr symlinks.")
|
(:documentation "Deploy the STAGING dir, updating the .prev and .curr symlinks.")
|
||||||
(:method (staging)
|
(:method (staging)
|
||||||
(with-current-directory coleslaw-conf:*basedir*
|
(let* ((dest (deploy *config*))
|
||||||
(let* ((dest (deploy *config*))
|
(new-build (rel-path dest "generated/~a" (get-universal-time)))
|
||||||
(new-build (rel-path dest "generated/~a" (get-universal-time)))
|
(prev (rel-path dest ".prev"))
|
||||||
(prev (rel-path dest ".prev"))
|
(curr (rel-path dest ".curr")))
|
||||||
(curr (rel-path dest ".curr")))
|
(ensure-directories-exist new-build)
|
||||||
(ensure-directories-exist new-build)
|
(run-program "mv ~a ~a" staging new-build)
|
||||||
(run-program "mv ~a ~a" staging new-build)
|
(when (probe-file prev)
|
||||||
(when (probe-file prev)
|
(delete-directory-and-files (truename prev) :if-does-not-exist :ignore))
|
||||||
(let ((dest (truename prev)))
|
(when (probe-file curr)
|
||||||
(if (equal prev dest)
|
(update-symlink prev (truename curr)))
|
||||||
(delete-file prev)
|
(update-symlink curr new-build))))
|
||||||
(run-program "rm -R ~a" dest))))
|
|
||||||
(when (probe-file curr)
|
|
||||||
(update-symlink prev (truename curr)))
|
|
||||||
(update-symlink curr new-build)))))
|
|
||||||
|
|
||||||
(defun main (config-key)
|
(defun main (config-key)
|
||||||
"Load the user's config section corresponding to CONFIG-KEY, then
|
"Load the user's config section corresponding to CONFIG-KEY, then
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
#:mappend
|
#:mappend
|
||||||
#:compose)
|
#:compose)
|
||||||
(:import-from :closure-template #:compile-template)
|
(:import-from :closure-template #:compile-template)
|
||||||
|
(:import-from :cl-fad #:delete-directory-and-files)
|
||||||
(:export #:main
|
(:export #:main
|
||||||
#:preview
|
#:preview
|
||||||
#:*config*
|
#:*config*
|
||||||
|
|
Loading…
Add table
Reference in a new issue