1

Context

My team maintains a website which is accessible only via HTTP (visitors) and FTP (modifications).

Several people need to edit it, and need to push changes fast, without waiting for anybody, because everybody else might be on vacation or at home when a modification is needed.

This leads to conflicts, and overwriting previous changes if not extremely careful, or just when having the bad luck to upload your modified file at the exact same time as another person.

Everyone is familiar with Git, so I want everybody to edit a Git version of the website. Git will solve the conflicts problem.

What I am looking for

I need a webapp that takes from a Git repository (Bitbucket), and pushes (overwrites) to my FTP server at every new git push.

Alice -------V
Bob ------> Git ----> webapp ----> FTP
Clark -------^

After we set up this webapp, I will forbid everyone from connecting via FTP. Only the webapp will be able to connect via FTP, everyone will be using Git only.

Requirements:

  • Allows to specify files that should NOT be overwritten. For instance I have a "analytics" folder that contains a .htaccess file (which must be overwritten) and xyz[...].log files which must NOT be overwritten
  • Free
  • Supports SFTP
  • As easy as FTPloy: just authorize on Bitbucket and fill the FTP credentials, that's all.

FTPloy does exactly this, but it overwrites everything ("Exclude files/dirs from deployment" is far away on their roadmap), so it does not fit my first requirement.

  • 3
    You're sure you need a webapp for this, and not just a simple post-commit-hook script? You might wish to take a look at Using Git to manage a web site. As for excluding files from being "deployed": That could be done in the post-commit-hook script as well. // Umm, and we probably are not speaking of "commit", but "push", aren't we? Commits are done to the devs local repo AFAIK </smart-ass-mode> ;) – Izzy Jul 9 '14 at 9:02
  • @Izzy: Would the post-commit-hook script be executed on the Bitbucket server, or on each person's local computer? – Nicolas Raoul Jul 9 '14 at 10:43
  • Depends on how you set it up. A post-commit-hook is usually implemented on a local repository. What you're after is a post-receive-hook as described behind the link in my previous comment. You could take the example from there, and simply adjust the script to match your needs (I'm new to Git, and didn't use this yet, so I cannot give you closer details as I've no experience with that part yet – though I plan to use exactly this in the future for easy web deployment). Using rsync with an exclusion list might be a better idea than ftp, though ;) – Izzy Jul 9 '14 at 10:49
  • confluence.atlassian.com/display/BITBUCKET/… Bitbucket does not accept custom personal hooks: they only let you choose from a list of existing services. So it seems that sever-side is impossible. Also, client-side is risky because password would be stored in clear on each person's computer (or asked every time which is worse), and because it does not fit my 4th requirement. – Nicolas Raoul Jul 9 '14 at 12:34
  • Oh – I wasn't aware of restrictions from that end, sorry. Would have been too easy a solution. I don't know about there "list of existing services" (and how your "webapp" could plug in there anyhow), so my last idea on this is either using a different service (a git host should be simple to set up on your own (web-) server, and the post-receive-hook could also be configured to push to bitbucket, if that's needed) – So Alice, Bob, and Clark would push to your new Git, which does a (local) checkout to your web-tree and then forwards the push to bitbucket. – Izzy Jul 9 '14 at 13:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.