Deploy destination via rsync broken by including *default-pathname-defaults*
tlavoie opened this issue · 2 comments
I am using the rsync deployment method, pushing from a local filesystem to my remote site, so for example, calling (coleslaw:deploy-dir coleslaw:config) would return:
#P"username@hostname:public_html/fd_coleslaw/"
In rsync.lisp, this gets used as: (merge-pathnames (deploy-dir config)), which is therefore prepending the local path default to the remote rsync destination. Naturally, this fails. On my local system, if I start SBCL in the coleslaw site folder, I would get:
#P"/home/tim/Web/fd_coleslaw/username@hostname:public_html/fd_coleslaw/"
The most obvious change is to simply call the destination with (deploy-dir config) and be done with it, so I guess I am wondering why this is the way it is, e.g. have I misunderstood the intent and then called it wrong. (e.g., how could this have ever worked?)
Related, use of default-pathname-defaults for the source folder, and therefore having to start the lisp in that folder, I did not see mentioned in the docs. In my view, this might be better done as an explicit option in .coleslawrc; this would then work fine when starting the lisp from within SLIME for example, where the starting folder may be something unrelated.
So, this one-line change to rsync.lisp works for me on the destintaion aspect:
(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)
(deploy-dir config)))
(defun enable (&rest args)
(setf args args))
Sorry for lack of formatting there. In any case, it's the absence of (merge-pathnames) on the destination directory.