Issue with nanoc deploy with rsync on a different port, plus alternative deployment advice from a GIT repo?

35 views
Skip to first unread message

Dave Everitt

unread,
Feb 9, 2020, 9:36:24 AM2/9/20
to nanoc
I've had previous issues with rsync, but moved the site to another server where we've restricted access by port (i.e. not 22) and am getting another error. My setup:

deploy:
  default:
    kind: rsync
    dst: 'username@SERVERIPADDRESS:PORT/home/user/webapps/html'

I'm using a high-numbered port specified in the address (:PORT), but getting the following error:

exit status: 255
  stdout: Nothing written
  stderr: ssh: connect to host SERVERIPADDRESS= port 22: Connection refused

although the correct port is specified in the dst value, it seems to be ignored - is there a way to specify the port in nanoc.yaml?

To confirm: I can SSH in on the command-line using these credentials.

Places I've looked:

Or would I be better going all the way with GIT? We've used GIT for pushing other non-nanoc sites to the same server, but the GIT repo for this site (current single remote on GitHub) covers the entire nanoc folder, excluding "output" - for now I'd rather to avoid the complexity of fiddling with the 'output' directory to make it a separate repo - unless there's an easier way.

Denis Defreyne

unread,
Feb 9, 2020, 10:04:20 AM2/9/20
to na...@googlegroups.com
Hey Dave,

Try adding this to the rsync options in the configuration file:
options: [ '-e', 'ssh -p myport' ]
... replacing myport with the port number.

Rsync runs over SSH, so to run it over a different port, you specify a different SSH command (with the port) using -e.

Hope this helps,

Denis

--
You received this message because you are subscribed to the Google Groups "nanoc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nanoc+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nanoc/e993e3ef-3529-4d33-9d41-55897c4c1d18%40googlegroups.com.
Message has been deleted

Dave Everitt

unread,
Feb 9, 2020, 10:46:33 AM2/9/20
to nanoc
thanks Denis

that got a little further, but although the path is correct:

TTY::Command::ExitError: Running `rsync -e ssh\ -p\ 24718 /PATH_TO_LOCAL_SITE/output/ USER@IPADDRESS/home/USERNAME/webapps/html` failed with
  exit status: 3
  stdout: skipping directory .
  stderr: rsync: change_dir#3 "/PATH_TO_LOCAL_SITE//USER@IPADDRESS/home/USERNAME/webapps" failed: No such file or directory (2)
rsync error: errors selecting input/output files, dirs (code 3) at main.c(706) [Receiver=3.1.3]

I'm actually getting better results by using GIT after I:
  • set up a bare GIT repo in the user folder but outside the remote website root
  • set my deploy block "remote" value to the bare repo
  • use a "hooks/post-receive" script inside my remote repo to copy the files to the site root (not yet working, but see below)
Now nanoc appears to deploy without error:

No issues found. Deploying!
Deploying via Git to branch “master” on remote “ssh://USERNAME@DOMAIN:PORT/home/USER/REMOTE.git”…

However, my remote repo on the server isn't getting updated on "deploy":

Deploying via Git to branch “master” on remote “ssh://USERNAME@DOMAIN:PORT/home/USER/REMOTE.git”…

Although there's no error. So if you can spot anything obvious, let me know!

Dave Everitt

unread,
Feb 9, 2020, 11:13:49 AM2/9/20
to nanoc
Solved!

After:
  • accepting the SSH cert locally
  • adding the remote path to GIT in the "output" repo
  • `chmod +x` the "post-receive" hook on the server
nanoc is now happily deploying using GIT!

I can only thank you for setting up nanoc internals so this is relatively easy i.e. knowing that `nanoc deploy` means the output dir when using a GIT repo (with the correct remote) inside it.

I wish I could mark the post "solved" or change the title… it wasn't too painful after all.

I still have other nanoc sites that use rsync, so I'll see how it goes with them.

Dave Everitt

unread,
Feb 10, 2020, 6:04:09 AM2/10/20
to nanoc
Briefly - Denis, if you want me to add this GIT method (to a server rather than to GitHub pages) to the Nanoc deployment section of the docs I'd be happy to when I get a moment. The full details are on my edited post at ServerFault. Just let me know.

Pito Salas

unread,
Mar 31, 2020, 9:24:46 AM3/31/20
to na...@googlegroups.com, Julian Ho
Hi there,

Has anyone tried to generate slides (i.e. presentations) from the markdown using nanoc? Any tips?

- Pito

Dave Everitt

unread,
Apr 1, 2020, 6:55:13 AM4/1/20
to nanoc
Hi Pito  - this seems like it needs a new post rather than adding to this one? BTW I use pure Markdown and Reveal.js for slides, although nanoc could handle this with a right Reveal-based layout… - Dave
Reply all
Reply to author
Forward
0 new messages