Skip to content
Grav 2.0 is officially stable. Read the announcement →
Archive

Deploying with SFTP only

Started by Muut Archive 11 years ago · 8 replies · 631 views
11 years ago

Hi,

I am trying to find the best way to deploy a Grav site in a situation where I can only connect to the server by SFTP - I don't have shell/SSH access or a control panel etc.

I have been experimenting with dploy - which purports to do exactly what I want (i.e. intelligently deploy changes from a git repo over SFTP from the command line), but I can't get it to work reliably.

I'd like to end up with a system where the entire site is kept, versioned, on Bitbucket/GitHub and relatively non-technical authors/administrators can make changes to the content of the website, push their changes to the repo and then deploy them to the production website.

Any ideas?

11 years ago

Hi,

I also have the same problem that I solved with lftp, on Ubuntu.

This recipe, in a file called eg. COMMAND.SH, to make the idea

BASH
#!/bin/bash

lftp -u USERNAME,PASSWORD DOMAIN_OR_IP << EOF

cd FTP_PATH
put LOCAL_PATH/FILE.MD

bye
EOF

Then, at the command line, run ./COMMAND.SH

(As soon as possible I will show you the site (to add it in the Sample Sites Grav) that I am building with the amazing and powerful GRAV)

Good work

11 years ago

Those symbols in capitals in your script are shell variables that are set-up first?

Note that dandelion figures out what to sftp by looking into the change set of the git repository. I mean, the very first time that dandelion runs, it sftp the whole of Grav. But after committing a single new blog (and maybe a tweak in a twig template), dandelion figures the minimal number of file to transfer based on git differences. There's no need for you to think in terms of cd ..., put ... Dandelion also creates the necessary directories.

11 years ago

If you guys are using SFTP only and have no access to shell to clear cache when needed, you probably should look at the cachebuster plugin. This lets you clear the cache via the browser which is a convenient thing.

11 years ago

You're right EOF only have to leave it as it is, the capitalized words are to be replaced with your values, for example. if your FTP username is franchan if your PASSWORD is newyork, if your DOMAIN_OR_IP is franchan.com then you must write

TXT
lftp -u franchan,newyork franchan.com << EOF

You have to change again FTP_PATH, LOCAL_PATH and FILE.MD

I hope I have clarified

11 years ago

As a proof of concept, I set up my site to deploy as you imagined Ross. I sync only the relevant files from my local installation (using Bitnami) to Bitbucket (using SourceTree), and then deploy this with Deploybot (previously Dploy.io) over SFTP. Finally, Deploybot allows shell-commands so I can clear cache after the deployment.

This preserves privacy, in that the Bitbucket repo is private, security from all transactions being encrypted, and ease-of-use by all links in the chain having fairly understandable GUI's.

For a future iteration I would like to achieve something similar on mobile devices: Writing content that is only synced and deployed when connected to the internet, and with a comfortable interface for phones. I haven't yet found a stable way of doing this though, hopefully Grav's webhooks will end up in the documentation soon so various integration's can be explored.

11 years ago

beyond compare supports SFTP, that's how i usually upload mine.

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1350 9 years ago
Archive · by Muut Archive, 9 years ago
2 935 9 years ago
Archive · by Muut Archive, 9 years ago
2 4061 9 years ago
Archive · by Muut Archive, 9 years ago
1 2948 9 years ago
Archive · by Muut Archive, 9 years ago
3 1119 9 years ago