Giter Club home page Giter Club logo

git-deploy-php's Introduction

git-deploy-php's People

Contributors

jessedobbelaere avatar maskas avatar pocketarc avatar roibeart avatar sbtsrbayer avatar tijmenb avatar tornskaden avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

git-deploy-php's Issues

Error readme

  • Create the deploy.ini file (see below).

If you run "php git-deploy" git-deploy-php wants run "git-deploy.ini" and not "deploy.ini"

Else, really good job !

Creates empty files on server

I ran the script after configuring the ini files. It made empty files on the server. All the files were just empty. Am i doing anything wrong ?

set up deploy.ini

Hello and thanks for your code!!

I have some difficulties setting up deploy.ini . From your file I have commented all but leaving option as normal.

skip = false
user = "user"
pass = "password"
host = "host"
port = 21
path = "/httpdocs/"
passive = true

Obviously values are fakes. With "" or not I have same error by my terminal:

PHP Warning: array_merge(): Argument #2 is not an array in
/var/www/git-deploy.php on line 627

I have just updated up to php 5.5 , probably is here the problem.

Thank you

Problem with pictures when i deploy

Hello,

In my git repository i have some pictures in the assets folder. When i try to deploy my web application, all pictures files not really uploaded ...

I checked in my Ftp with filezilla, and all pictures exists but with 4KB than 1mb for example.

Do you know why ?

Thx ๐Ÿ‘

[Feature] Uploading of untracked files

Use cases:

  • generated .pdf file (through TeX, can't be done on production server)
  • generated .css files, such as Sass (which you can't generate on production for lack of Ruby)
  • other similar cases

Issues:

  • The configs are target-specific, while the list of untracked files to upload would be same for development/staging/production (in my case, I only have development (my git checkout) and production (3rd party hosting accessible through ftp), so this doesn't affect me personally).

Please see my commit in my fork for a quick & dirty solution. Can you come up with something better?

Unable to access the git repository's folder.

Love the idea of this script but having a few issues getting it setup.

I'm using the following for my deploy.ini:

; This is a sample deploy.ini file.

[example]

scheme = sftp
skip = false
user = root
pass = password
host = 162.243.152.193
port = 22
path = /root/nols
passive = true

I dropped the git-deploy.phar file in the root of my project. I've tried with and without the /tools folder as well but I keep getting

Unable to access the git repository's folder.

and

Warning: chdir(): No such file or directory (errno 2) in phar:///...git-deploy/src/Git.php on line 95

I have an inited .git folder with a few commits as well and my hosting is on digital ocean. I can SSH and SFTP into the account without trouble.

Thanks for your help!

wrong behaviour of git deploy -l

git deploy -l lists all the files in repo, independently of revision deployed to ftp. This is kindda useless IMHO. Could be solved by storing revision deployed to ftp locally.
As there can be multiple ftp servers defined in config, multiple revision files would have to be created or some sort of parsing to put them into 1 file. What do you think?

Parallel Transfers

It occurs to me that the transfer speed could be increased greatly by simply running multiple file transfers at the same time. Would be nice to have some sort of multi-threading in place. Hmm, I wonder how this would be possible.

some directories are not transferred

hi, I noticed another problem - I was trying to deploy a project based on cakephp (www.cakephp.org); basically there are a lot of files to be transfered. But somehow, some directories were not created/transfered to the server. Unfortunately I was not able to spot the problem (these files/dirs have the same properties as the others).

Maybe there is some bug when the system tries to copy files to an inexistent directory?
I will follow up with more info if possible...

thx, dan

Use Phar

Use phar to combine git-deploy-php + phpseclib, because having git-deploy-php's file loaded with phpseclib's entire code makes it much less friendly to work with. This'd open the doors to separating all the classes into their own files and keeping the code perfectly organized, without affecting normal use of git-deploy-php.

Linux/Mac Testing

I haven't tested this on Linux or Mac yet, but I'd like to, and I'd like to make sure everything's working perfectly in both those OSs.

Project Local Path

Is it possible to set the project's local root path in the config file? It would be very useful for deploying multiple git projects at once using only one config file.

If not, what would be the easiest approach of implementing this feature? E.g. which functions are important...

Thanks for this awesome script!

PS: I know I'm trying my luck here. The neatly typed usage document, states that one should drop the deploy script within a project. It suggests that one should have git-deploy-php and a set of config file for each git project.

Feature request: optional git revision

I am going to give this a test drive but a feature that I see as missing (and which would make me stay with my current, not so wonderful, Capistrano deployment tool) is the ability to UNDO a deployment. Seems to me that the easiest way to implement such a feature would be to allow an optional revision number as an argument. Doable?

Multiple branches and multiple servers

Hello,
This project seems exactly what i need, but i wonder how to handle deployment of multiple branches to multiple servers.

If i have staging.ini and live.ini files and a "staging" branch and "live" branch is there a way to make sure only branch "live" will use live.ini ?

Is it working?

The latest version gives me following error. Is it working for others?

PHP Fatal error: Class 'Brunodebarros\Gitdeploy\Brunodebarros\Gitdeploy\Git' not found in phar:///var/www/impresspages.org/git-deploy/src/Server.php on line 82
PHP Stack trace:
PHP 1. {main}() /var/www/impresspages.org/git-deploy:0
PHP 2. Brunodebarros\Gitdeploy\Server->deploy() /var/www/impresspages.org/git-deploy:52

Update to specific revision

The ability to do:

git-deploy-php [deploy-file] [revision-hash]

Would allow reverting when things go wrong. Ideally, would have support for "HEAD" (HEAD being the default when the argument is omitted).

Tinkering with the idea of a "previous", which would allow you to revert without having to find the previous revision's hash. But, "previous" is ambiguous. Previous revision or previous deployed commit? In the case of previous revision, it'd be easy. But what if a guy made 50 revisions since the last deployment, then deploys them all? Then "previous" would revert one revision, but leave the other 49 revisions. Pretty stupid, IMHO.

So, it is my opinion that the previous deployed revision should be stored in a PREVIOUS_REVISION file, along with the REVISION file. That file would allow doing git-deploy-php [deploy-file] previous, and easily revert to the previously deployed revision. So if you deploy something that breaks your production website website, git-deploy-php production previous would fix it. Pretty neat. :D

Reconnect on upload failure

Right now, if git-deploy fails to upload, it will try uploading again using the same connection, 10 times. If that fails, it stops, and you have to restart the upload.

Change it so that instead of using the same connection, it closes it and opens a new one, to try again. This will avoid an issue I've been having with 1000+ file uploads, where it stops halfway.

Can I use git-deploy to transfer files to a server without git?

I have my remote git repo at hosted online, my machine has a working git installation and I pull and push stuff with ease when it comes to the remote git repo. What I want to do is to deploy my files on a separate server, which doesn't have git. Is that possible?

I'm just tired of hand picking each and every file that needs to be uploaded.

Submodule (Plugin/DragDropEditor) deploy error

I have a submodule. And it successfully uploads everything for the first time. Nest upload fails with the error:

php git-deploy
[2014-10-09 00:24:28 +0300] Connected to: ftp://xxx/public_html
[2014-10-09 00:24:28 +0300] Started working on: ftp://xxx/public_html
[2014-10-09 00:24:28 +0300] Updating server from 7c57b8 to 15cd26...
[2014-10-09 00:24:28 +0300] Plugin/DragDropEditor
[2014-10-09 00:24:28 +0300] Will upload 11 files.
[2014-10-09 00:24:28 +0300] Will delete 0 files.
PHP Warning: ftp_put(): Can't open that file: Is a directory in /xxx/git-deploy on line 510
PHP Stack trace:
PHP 1. {main}() /xxx/git-deploy:0
PHP 2. main() /xxx/git-deploy:32101
PHP 3. Server->deploy() /xxx/git-deploy:14
PHP 4. FTP->set_file() /xxx/git-deploy:283
PHP 5. ftp_put() /xxx/git-deploy:510
[2014-10-09 00:24:37 +0300] Deleted: Plugin/DragDropEditor
PHP Warning: ftp_put(): Can't open that file: Is a directory in /xxx/git-deploy on line 510
PHP Stack trace:
PHP 1. {main}() /xxx/git-deploy:0
PHP 2. main() /xxx/git-deploy:32101
PHP 3. Server->deploy() /xxx/git-deploy:14
PHP 4. FTP->set_file() /xxx/git-deploy:283
PHP 5. FTP->set_file() /xxx/git-deploy:519
PHP 6. ftp_put() /xxx/git-deploy:510
[2014-10-09 00:24:37 +0300] ERROR: Failed to upload Plugin/DragDropEditor. Deployment will stop to allow you to check what went wrong.

Custom ini files at deploy time

It would be nice to let the user choose the ini file. ex:

php git-deploy ... would use the default (deploy.ini)
php git-deploy ... -istaging would use the staging settings (staging.ini)

ssh support

hi, are you planning adding ssh support?
best, dan

Files are copied with 0 bytes

Problem : The files are copied with 0 bytes on Windows environement. After digging a bit on the code, I fixed the issue by adding double quotes instead of single quotes in the following method:
Git::get_file_contents()
$this->exec("show $path", "> "$temp"");
Single quotes don't work in windows.

Cheers

git source?

Where do I specify the git source from which I'm pulling?

Thank you

Skip unmodified files

Hello, it would be a nice feature to have unmodified files skipping. What do you thing, guys? I mean untracked files by git.

FTP Password

Git-deploy cannot handle passwords with special symbols. I had an FTP password like this:

hU[Irp:Eb}Ov:uC#

It would simply fail to login.

Upload to ftp on nitrous.io

Since a few weeks we use nitrous.io to develop our sites (very interesting project). When we deploy to a sftp server all is good. But ftp is not working. The console doesn't show any log message. Likely it's a problem at nitrous.io but i cannot debug it. Any ideas?

Nitrous has free accounts so if you want you can signup for free.

clean_directories[] works only for files

If we use clean_directories[] to empty a directory, only the files from it will be deleted. For any subdirectory we will receive a warning message telling that a directory can't be deleted, not it's content is being deleted.
What do you think about recursive check and removing all nested directories from the directory we put in clean_directories[]?

Do not upload self

git-deploy is uploading its own file, which rather sucks. Should also not upload the .ini with FTP configurations, this is a security issue (hadn't thought about that! :O)

Corrupt uploading Font, Ico files

When uploading fonts from extensions .woff .eot .ttf .svg .otf they become corrupt. It seems that they are uploaded in ASCII mode instead of binary mode. Favicon with the extension .ico has the same problem.

Create unit tests

We need unit tests to automatically verify that everything is working. I'll have to setup some FTP/SFTP credentials without any sort of permissions in a throwaway dev vps to test this correctly.

Problem deleting folders

Because of the way git works, when deleting a folder from git, the only changes that are tracked are the files that are deleted, not the folders. As a result, it is impossible to figure out whether a folder was deleted or whether it was only its contents that were removed. This has to be sorted out. Somehow.

Fatal error: Allowed memory size in git-deploy on line 157

Got this error:

[2014-08-15 21:15:00 +0200] Deploying to server for the first time...
sh: -c: line 0: syntax error near unexpected token (' sh: -c: line 0:git show d6f85a2aa7b46049ab9dd6161abb098b5b59c6fd:uploads/score/score-35-1370971179-4356572206042(1).pdf 2>&1 > "/private/var/folders/xf/vhr6fx9s2z78q3_7yqbbmzqc0000gq/T/git-deploy-JRNstR"'
sh: -c: line 0: syntax error near unexpected token (' sh: -c: line 0:git show d6f85a2aa7b46049ab9dd6161abb098b5b59c6fd:uploads/score/score-35-1370971305-4356572206042(1).pdf 2>&1 > "/private/var/folders/xf/vhr6fx9s2z78q3_7yqbbmzqc0000gq/T/git-deploy-fsNjGp"'

Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 3234379 bytes) in /Applications/MAMP/htdocs/myproject/git-deploy on line 157

Add support for resuming uploads

Create a DEPLOY_RESUME_[project]_[hostname] file in the same directory as the deploy.ini while uploading. That file should be updated with every file that's uploaded (and the commit hash that is being deployed). This will allow for resuming deployments.

The file is deleted when deployment is over, obviously.

When hitting "deploy", if it finds a resume file, it'll resume the upload, finish the upload, and THEN continue deploying new commits.

Nothing Responding

On my local machine, running php git-deploy seems to process momentarily and then simply prompts me as if i'd done nothing at all.
2014-10-20 21_20_47

git-deploy-php uploads files in working dir

When deploying, git-deploy uploads the files in my working dir, not the files in the git repo. So if I made changes that I haven't committed, they're still deployed. This isn't the way it's meant to work at all.

Source Files

You it seems you have removed the source files from the repo.

Can you please provide those.

Deploy using "branch: branch-name" misses tracked/modified files

Deploying from the branch "deploy" but setting a different branch in the .ini to ex: "20150316-update" doesn't deploy all tracked files. But when the .ini and .git-deploy script are dropped in the "20150316-update" branch, everything is deployed properly. Does the "deploy" branch need to be merged or updated to catch all tracked/modified files?

Thanks for your help! Git Deploy kicks some serious ass!

submodule files are not uploaded

hi, I have encountered a problem. it seems that git ls-files ignore the ones that belong to submodules and therefore they are not uploaded at all to the server.
I've been reading through the man, but I could not find any solution by now, other than adding those files directly - which is a hassle.
maybe you have an idea on how to add them to the list?
thx, best, dan

Clean directories uses incorrect recursive path?

I noticed that the directories I specified with clean_directories[] are not cleaned up after uploading.

Warning: Invalid argument supplied for foreach() in /.../git-deploy on line 516

I tried to debug the problem. By logging the steps in the recursive_remove function, I found out that the files are found. But when they reach the foreach loop, the recursive function adds the path a second time to the files, resulting in a false path like: frontend/cache/compiled_templates//frontend/cache/compiled_templates/test.txt

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.