pocketarc / git-deploy-php

git-deploy-php is a simple php-based tool that deploys your Git repositories to FTP/SFTP servers, and keeps them updated automatically.
http://brunodebarros.github.io/git-deploy-php
292 stars 45 forks source link

git-deploy with Travis CI #75

Open teanocrata opened 8 years ago

teanocrata commented 8 years ago

I'm using git-deploy from Travis CI. I use a custom script Script Deployment in Travis CI and I encrypt user and password of FTP Encryption keys.

For these reasons I need to pass FTP_USER and FTP_PASSWORD like options to git-deploy, I've develop in my fork of git-deploy these features (and one fix for #73 and #74 ).

I think these features would be great in upcoming releases.

You can view an working example of Travis CI + git-deploy in my project Git Open Smart Country. I use git-deploy to deploy Web folder to my hosting, I use simpletest to test php code and Travis CI launch the test and if all of them success, it runs git-deploy to deploy Web folder to Open Smart Country

pocketarc commented 7 years ago

Wow, I can't believe I didn't see this before! This is pretty cool, I'd love to use git-deploy-php with Travis for my own projects!

My immediate concern with your way of doing it is that it seems that it would only work for 1 user/password combination, which is of limited use: Anyone with more than one server wouldn't be able to use this, myself included.

It occurs to me that Travis CI allows you to pass secure ENV variables, so we could use those instead to pass the encrypted passwords to git-deploy-php, as SERVERNAME:PASSWORD. Then, all we would have to do is look for $_ENV["SERVERNAME:PASSWORD"] or something like that. And that would allow us to make it work in a way that would accept passwords for all servers, not just one, and it wouldn't be hardcoded.

Is there any reason something like this wouldn't work?