0

When cloning CE and deploying on Gandi servers, following their own instructions, the process is aborted with the error mentioned in the title.

Preconditions

  1. Magento 2.2.1 CE
  2. PHP7.1
  3. MySQL 5.6
  4. Gandi.net servers - simple hosting instance
  5. Local machine is ubuntu 16.04 x64

Steps to reproduce

  1. Following directions from gandi.net here and here.
  2. Enter following commands:

    $ cd ~
    $ mkdir [VHOST_NAME]
    $ cd [VHOST_NAME]
    $ git remote add gandi git+ssh://[USER_ID]@git.[SERVER].gpaas.net/[VHOST_NAME].git
    $ composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition htdocs
    $ git add .
    $ git commit -m 'Install Magento 2'
    $ git push gandi master
    $ ssh [USER_ID]@git.[SERVER].gpaas.net deploy [VHOST_NAME].git
    

Expected result

  1. 'Build complete' message should be seen in terminal.

Actual result

  1. Completed up to step 10 of 'Steps to reproduce' successfully.
  2. Step 11 fails with error message:

    composer.json and composer.lock files should be placed outside the htdocs directory.

1 Answer 1

0

It seems that the problem lies with gandi.net's servers and the way in which they configure composer.

I first attempted to solve this by installing via composer locally, then pushing to the master branch. I'm not sure why, but not all of the files were pushed and it was still required that I execute $ composer install from within the magento directory, with composer.json and composer.lock files present.

Solution 1

The only clean solution I have found which adheres to Magento's guidance, is logging in to the server via ssh and executing the $ composer create-project ... command directly.

Unfortunately, whilst this does install a properly functioning instance of Magento, it does not allow me to take advantage of Gandi's git features.

Solution 2

This solution adheres to the composer/git installation instructions provided by Gandi.net.

Following the guidance, before committing any changes to gandi master and executing Gandi's deployment script, I created a .gitignore file within the local repository to exclude htdocs/composer.lock and htdocs/composer.json.

I then followed instructions from the 'Deploy to your instance' section of Gandi's guidance and, once properly deployed, I manually added both files to the instance and executed $ composer install on the server via ssh.

In order to ensure continuity between repositories, updates administered via composer or changes to composer files must take place separately on any local repositories as well as the instance.

Note: This solution is not particularly graceful when the git project has multiple users and may lead to incompatibility issues if updates are not properly executed.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.