coleslaw-org / coleslaw

Flexible Lisp Blogware
BSD 2-Clause "Simplified" License
553 stars 82 forks source link

Deploy destination via rsync broken by including *default-pathname-defaults* #198

Open tlavoie opened 3 years ago

tlavoie commented 3 years ago

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.

tlavoie commented 3 years ago

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))

tlavoie commented 3 years ago

Sorry for lack of formatting there. In any case, it's the absence of (merge-pathnames) on the destination directory.