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)
|
||||
(:documentation "Deploy the STAGING dir, updating the .prev and .curr symlinks.")
|
||||
(:method (staging)
|
||||
(with-current-directory coleslaw-conf:*basedir*
|
||||
(let* ((dest (deploy *config*))
|
||||
(new-build (rel-path dest "generated/~a" (get-universal-time)))
|
||||
(prev (rel-path dest ".prev"))
|
||||
(curr (rel-path dest ".curr")))
|
||||
(ensure-directories-exist new-build)
|
||||
(run-program "mv ~a ~a" staging new-build)
|
||||
(when (probe-file prev)
|
||||
(let ((dest (truename prev)))
|
||||
(if (equal prev dest)
|
||||
(delete-file prev)
|
||||
(run-program "rm -R ~a" dest))))
|
||||
(when (probe-file curr)
|
||||
(update-symlink prev (truename curr)))
|
||||
(update-symlink curr new-build)))))
|
||||
(let* ((dest (deploy *config*))
|
||||
(new-build (rel-path dest "generated/~a" (get-universal-time)))
|
||||
(prev (rel-path dest ".prev"))
|
||||
(curr (rel-path dest ".curr")))
|
||||
(ensure-directories-exist new-build)
|
||||
(run-program "mv ~a ~a" staging new-build)
|
||||
(when (probe-file prev)
|
||||
(delete-directory-and-files (truename prev) :if-does-not-exist :ignore))
|
||||
(when (probe-file curr)
|
||||
(update-symlink prev (truename curr)))
|
||||
(update-symlink curr new-build))))
|
||||
|
||||
(defun main (config-key)
|
||||
"Load the user's config section corresponding to CONFIG-KEY, then
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
#:mappend
|
||||
#:compose)
|
||||
(:import-from :closure-template #:compile-template)
|
||||
(:import-from :cl-fad #:delete-directory-and-files)
|
||||
(:export #:main
|
||||
#:preview
|
||||
#:*config*
|
||||
|
|
Loading…
Add table
Reference in a new issue