Search code examples
gitdeploymentgrav

Issue when deploying GRAV site using git on Gandi.net simple hosting


I have a new site that I have prepared with Grav and that I'm willing to deploy on my Simple hosting instance on gandi.net.

I have saved my developments using git on my bitbucket account. All fine. I have configured my git access to the simple hosting. All fine as well.

But when I deployed my Grav code (the deploy command on Gandi is apparently a local git checkout), all my code was deployed at the host root, besides htdocs/ and not into it.

I then changed my local structure via git to include all my code into a local htdocs directory. But then, deploying it on Gandi returns me the following message:

initializing builder
......................builder ready
Vm password:
Grabbing terminal
Ok
-----> Starting new deployment (gare.humoeursvertes.net - master)
-----> Fetching application code
-----> Building new application
ERROR: composer.json and composer.lock files should be placed outside the htdocs directory (../htdocs/)
Dependencies could not be installed. Exiting...
Please refer to the documentation:

[fr] http://wiki.gandi.net/fr/simple/instance/php-mysql?&#composerlock
[en] http://wiki.gandi.net/en/simple/instance/php#dependency_management
-----> Building new application failed
-----> Aborting deployment

Apparently, I cannot do that :-( But what is the solution then? I cannot find any, and Gandi support is not responding...

I assume I should change the target directory of the deploy (aka git checkout) done on Gandi, but cannot find any way to do so. Any hint welcome ! Thanks, Xavier


Solution

  • The solution was much easier than expected. It is because the Grav packages come with composer.json and composer.lock configuration files, and Gandi does not accept such files in the htdocs directory. I therefore had to - keep everything into the htdocs directory - but these two files that I have moved besides (and not inside) htdocs

    Then the deploy works like a charm. (same solution as for a symfony deployment: http://rockstarninja.labak.xyz/gandi-sh-installation-de-symfony-3-2-sur-une-instance-simple-hosting-de-type-php-5-6/).