Sublime Forum

Tip on webserver/CMS workflow (SFTP/git)

#1

Hi!
I’m developing some websites, using serverside blog and CMS solutions.
I love to keep working on planes and such, so as of now, I’ve been running copies of these sites locally on my laptop.
I’ve checked all the files into GIT, and when I do changes to the files, I commit and push them to the test server.
If I also make changes to the CMS/blog through the web interface, I need to do a mysqldump locally and restore on the server.
(So far I haven’t tried the git package functionality in Sublime. I’m a little new to git, so I’m getting to know it on the command line first.)

This setup works, but I’m playing with the idea of a file sync setup that lets me edit my files locally, but as soon as I’m online, it syncs my files to the server(s), sort of like how Dropbox works (transparent reconnect and background syncing).
If I still have to trigger sync manually, typing “git push” is just as simple …

Any recommendations on a better setup?
I’ve been reading some on various SFTP clients (for Mac), but many of them seems to get trouble if I’m offline. I just tried in Transmit 4 to mount the volume as a finder volume. If I then try to save while turning wifi off, I get I/O error …

Maybe Sublime Text 2 has some packages that I should check out? (I guess the editor can trigger Transmit or other apps, but what happens if I’m offline when I do Cmd+S?)

I guess it should be possible to make some script that detect network availability, that is triggered by changes to a folder (I think launchd can detect those), but I’m not sure I’m able to make that a robust/fail tolerant solution … What say you? :smile:

0 Likes

#2

You could try sftp plugin. Right click on the folder (in the sidebar) and chose: sync with remote. (also have a lot of other options, but this is what are you looking for).

0 Likes

#3

Personaly i dosent use FTP Live Editing, i switched to a Git Workflow. Its not so fast but more secure.

I use this script stephenradford.me/blog/tutor … vice-hooks. Upload the File on the FTP, than connect this script with a Service Hook from Bitbucket. Every time when i push my modifications on my repository, Bitbucket deploys this automatic on my FTP.

0 Likes

#4

I am using git, but a challenge is handling changes on the server (in the CMS), getting those into git.
So I was thinking I could work through sftp or something towards a lab server, where everything in the Document Root is in git. Then working toward that through SFTP, and pushing from there unto the prod server.
(Main benefit: Saving myself for quite a few “mysqldump > file”, “scp file remote-server:/path” and “ssh remote-server mysql <file” …)

With the SFTP package, will I have to trigger folder sync manually, or does it try whenever a network connection is available?
(Would be neat with Dropbox-like sync)

0 Likes