0

I installed Drupal on ubuntu 16.04 via composer and I'm trying to implement continuous integration with Jenkins. So, I would like to be able to work from another location (for example from a Windows 10 PC), and a push of my changes must trigger a build on jenkins that updates the installation on the ubuntu machine.

I verified that the created .gitignore file is this:

# Ignore directories generated by Composer
/drush/contrib/
/vendor/
/web/core/
/web/modules/contrib/
/web/themes/contrib/
/web/profiles/contrib/
/web/libraries/

# Ignore sensitive information
/web/sites/*/settings.php
/web/sites/*/settings.local.php

# Ignore Drupal's file directory
/web/sites/*/files/

# Ignore SimpleTest multi-site environment.
/web/sites/simpletest

# Ignore files generated by PhpStorm
/.idea/

# Ignore .env files as they are personal
/.env

So after having pushed the code into my git repository, I noticed that various folders are missing such as the "core" folder and I do not think that the project can work if the "core" folder is missing.

Do I simply have to update the .gitignore file? Or is there anything I need to understand better about the "modus operandi" in Drupal?

2
  • 1
    Composer will download core and all the other stuff. As they are declared as dependencies in you composer.json. You don't need to commit them. – leymannx Sep 20 '18 at 15:23
  • The standard D8 .gitignore already ignores some of your listings here. the redundant listings are: /web/sites/*/settings.local.php and /web/sites/*/files/. – LittleCoding Sep 20 '18 at 16:16
3

Your core directory is included in your .gitignore. I don't know which strategy you want follow but, like you have vendor, modules/contrib, themes/contrib, etc, you should launch composer install to download your core and contrib modules/themes in your workflow to complete your installation (your composer.lock should be commit).

If you prefer commit your modules, themes, profiles, libraries, core, etc., because some parts of your content are not managed by composer or because you don't want risk a bug of network during the build, you should remove these directories from your .gitignore and add them in your git repository.

2
  • composer install works, now what are the steps to do? I want to import configuration but I get an error when I launch the corresponding drush command drush config: import -y "Command config: import was not found Drush was unable to query the database ..." – Alessio Frabotta Sep 20 '18 at 16:18
  • Is your site installed? I mean, your database existant and not empty? You can't import your configuration if Drupal isn't installed and configuration manager module enabled. – Claire D Sep 20 '18 at 17:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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