Repository navigation
Description
Hi, I just installed in a virtual machine using ubuntu 20 a sftp server and on there I have a apache server and all my projects are saved inside of "var/www/html". To test this tool "git-deploy-php" I created another virtual machine with ubuntu and installed on there php and git.. I tested my sftp server and is working correctly, I can make a connection using my second virtual machine were I want to make the deploy and I also tested my sftp server with windows 10 using Filezilla and again I was capabable of upload files inside of "html" folder of the apache server.
My sftp user has permissions for write inside of "var/www/html".
I just created a folder with one index.html file which is the file that I want deploy in my server and also I created a .gitignore file to ignore this files "git-deploy.php and deploy.ini".
This is my deploy.ini code:
[example]
scheme = sftp
skip = false
user = "usuario_sftp"
pass = "123456"
host = "192.168.0.13"
port = 22
path = "/var/www/html/googleros"
passive = true
When I execute the git-deploy it was unable of uploade the index.html file, here is the logs:
devjunior@devjunior-pc:~/Documentos/proyects/googleros$ sudo php git-deploy deploy.ini
[2021-07-31 20:30:07 -0400] Connected to: sftp://usuario_sftp@192.168.0.13:22/var/www/html/googleros
[2021-07-31 20:30:07 -0400] Disconnected from: sftp://usuario_sftp@192.168.0.13:22/var/www/html/googleros
[2021-07-31 20:30:07 -0400] Started working on: sftp://usuario_sftp@192.168.0.13:22/var/www/html/googleros
[2021-07-31 20:30:07 -0400] Deploying to server for the first time...
[2021-07-31 20:30:07 -0400] Will upload 3 files.
[2021-07-31 20:30:07 -0400] Will delete 0 files.
[2021-07-31 20:30:12 -0400] Connected to: sftp://usuario_sftp@192.168.0.13:22/var/www/html/googleros
[2021-07-31 20:30:12 -0400] ERROR: Failed to upload index.html. Deployment will stop to allow you to check what went wrong.
It said: "ERROR: Failed to upload index.html. Deployment will stop to allow you to check what went wrong."
Before of run this I init a repo "git init" then I did "git add ." and then git commit -m "first deploy". and the executed git-deploy
I checked my branch and his name is "master", I'm supposing that this branch will be deployed in the production server.
This is my project:
is composer required? In my production server I only installed an apache server, php and mysql, is the problem with this rule [example] I don't know it.
I don't know the reason why this happens, it is my first time using this tool. I will appreciate any idea to fix this problem. Thanks so much.

Activity
pocketarc commentedon Aug 4, 2021
Does the
googlerosfolder exist? That's the only thing that comes to my mind as the reason why it might've gone wrong.Composer is not required, everything should work well.
If you're still having issues with this and that folder exists, let me know. I might be able to add some code to help explain what went wrong, since that error message is really not helpful at all.
alcarazolabs commentedon Aug 4, 2021
Thanks bro. The problem was in the path of the
deploy.inihere I was using/var/www/html/googlerosok. But when I tried to run the deploy I couldn't go to googleros/ because in the configuration of the filesshd_configof the sftp server the ruleChrootDirecotryhad this value /var/www/ it means that when an user make a connection by default will be positionate here inside of www/ but it can't go from /var/www/html/ then to fix this I updated my path of thedeploy.initohtml/googlerosand it worked!In general, what problems can have tool present? can you upload large files? files named with spaces? what should I know that I don't currently know.
Thanks.
The tool should allow you to create the folder on the production server if it doesn't exist. You could do something like
git-deploy --forceand it should create the directory inside the server and then run the deploy.pocketarc commentedon Aug 17, 2021
@alcarazolabs You shouldn't have any issues with uploads of files, regardless of size, spaces, anything like that. Everything should just work.
As for creating the folder if it doesn't exist, that's an interesting idea, but when the folder doesn't exist it's usually an issue with configuration (just like it was for you). Imagine if the tool had deployed thousands of files files to /var/www/html/etc inside your /var/www because of
ChrootDirectory(so it'd become /var/www/var/www/html/googleros). It's best to not try and get too clever in situations like this.