Merge pull request #152 from guicho271828/rsync-deploy

Removed the default deploy method and added RSYNC plugin
This commit is contained in:
Masataro Asai 2019-10-27 15:07:29 -04:00 committed by GitHub
commit 390af72d44
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 31 additions and 2 deletions

View file

@ -43,6 +43,8 @@
(sitemap) (sitemap)
(static-pages) (static-pages)
; (versioned) ;; *Remove comment to enable symlinked, timestamped deploys. ; (versioned) ;; *Remove comment to enable symlinked, timestamped deploys.
;; default deploy method is rsync
(rsync \"-avz\" \"--delete\" \"--exclude\" \".git/\" \"--exclude\" \".gitignore\" \"--copy-links\")
) )
:sitenav ((:url \"http://~a.github.com/\" :name \"Home\") :sitenav ((:url \"http://~a.github.com/\" :name \"Home\")
(:url \"http://twitter.com/~a\" :name \"Twitter\") (:url \"http://twitter.com/~a\" :name \"Twitter\")

View file

@ -7,6 +7,13 @@
* Available plugins are listed below with usage descriptions and * Available plugins are listed below with usage descriptions and
config examples. config examples.
## Direct deployment via rsync
**Description**: This directly sends the contents of the staging dir to the deployed directory.
The former default deployment method.
**Example**: `(rsync "--exclude" ".git/" "--exclude" ".gitignore" "--copy-links")`
## Analytics via Google ## Analytics via Google
**Description**: Provides traffic analysis through **Description**: Provides traffic analysis through

19
plugins/rsync.lisp Normal file
View file

@ -0,0 +1,19 @@
(defpackage :coleslaw-rsync
(:use :cl)
(:import-from :coleslaw #:*config*
#:deploy
#:deploy-dir)
(:export #:enable))
(in-package :coleslaw-rsync)
(defvar *args* nil)
(defmethod deploy (staging)
(coleslaw::run-program "rsync ~{~A~^ ~} ~A ~A" *args*
(merge-pathnames staging)
(merge-pathnames (deploy-dir *config*))))
(defun enable (&rest args)
(setf *args* args))

View file

@ -46,7 +46,8 @@
(defgeneric deploy (staging) (defgeneric deploy (staging)
(:documentation "Deploy the STAGING build to the directory specified in the config.") (:documentation "Deploy the STAGING build to the directory specified in the config.")
(:method (staging) (:method (staging)
(run-program "rsync --delete -avz ~a ~a" staging (merge-pathnames (deploy-dir *config*))))) "By default, do nothing"
(declare)))
(defun update-symlink (path target) (defun update-symlink (path target)
"Update the symlink at PATH to point to TARGET." "Update the symlink at PATH to point to TARGET."

View file

@ -21,7 +21,7 @@
(:default-initargs (:default-initargs
:feeds nil :feeds nil
:license nil :license nil
:plugins nil :plugins '((rsync "-avz" "--delete" "--exclude" ".git/" "--exclude" ".gitignore" "--copy-links"))
:sitenav nil :sitenav nil
:excerpt-sep "<!--more-->" :excerpt-sep "<!--more-->"
:charset "UTF-8" :charset "UTF-8"