Lullabot / drupal9ci

Command Line Interface for implementing Continuous Integration in Drupal 9
GNU General Public License v3.0
161 stars 55 forks source link

Is this still supported? #56

Closed safetypins closed 3 years ago

safetypins commented 3 years ago

I've run into several problems getting this to work with a Drupal 8 project. Both messages I've seen appear to be related to the configuration of the image. I got this error during "Checkout Code": mkdir: cannot create directory '/var/www/html': File exists and then I read one of the other issues suggesting this needed to be changed to /opt/drupal but when I changed all instances of var/www/html I got this error in "Setup and Run Unit and Kernel Tests":

    There are no commands defined in the "install" namespace.  

➜                                                                                                                  
➜   Requested RoboFile `/opt/drupal/RoboFile.php` is invalid, please provide valid absolute path to load Robofile. 
➜                                                                                                                  
➜                                                                                  
➜   Robo is not initialized here. Please run `robo init` to create a new RoboFile. 
➜                                                                                  
juampynr commented 3 years ago

Hi @safetypins! Yes, it is supported although I personally have not put work into it but I have reviewed and merged pull requests.

Regarding your issues, what CI tool are you using? Did you run the script to set up the scaffolding? Can you provide more details on the above issues?

safetypins commented 3 years ago

Hi @juampynr! Thanks for responding. I'm using CircleCI, and I know next to nothing about how to use it. My end goal is to run Behat and Visual Regression testing on Circle and/or platform.sh. I am familiar with setting up a LAMP VPS, but really only by following instructions. I don't understand how Docker images work with CircleCI enough to try to build my own, so I've been searching for CircleCI configurations that other people have shared and. I have yet to find one that completes it's build process without errors, let alone run tests.

The steps that led me to those errors were:

  1. Download and execute the setup script (https://github.com/Lullabot/drupal8ci/blob/master/setup-circleci.sh) in the Drupal project I would like to test.
  2. Try to make the path customizations necessary (we are using /docroot instead of /web inside the composer setup).
  3. Commit and push to GitHub, and watch the CircleCI build fail.

I also forked your d8cidemo repository and tried to run that in my CircleCI account without any changes, and ran into some errors that I don't remember now (I stopped following the repository in CircleCI and then I deleted my fork). I don't know what script to setup scaffolding you mean, so I'm gonna guess that I didn't run it. I thought that there wasn't anything else I needed to do besides run the setup script and customize paths. Here is more context from the CircleCI results:

AH00112: Warning: DocumentRoot [/var/www/html] does not exist
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 192.168.240.3. Set the 'ServerName' directive globally to suppress this message
AH00112: Warning: DocumentRoot [/var/www/html] does not exist
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 192.168.240.3. Set the 'ServerName' directive globally to suppress this message
[Wed Dec 16 13:02:28.585862 2020] [mpm_prefork:notice] [pid 423] AH00163: Apache/2.4.38 (Debian) PHP/7.4.10 configured -- resuming normal operations
[Wed Dec 16 13:02:28.585913 2020] [core:notice] [pid 423] AH00094: Command line: 'apache2 -D FOREGROUND'

  There are no commands defined in the "install" namespace.  

➜                                                                                                                  
➜   Requested RoboFile `/opt/drupal/RoboFile.php` is invalid, please provide valid absolute path to load Robofile. 
➜                                                                                                                  
➜                                                                                  
➜   Robo is not initialized here. Please run `robo init` to create a new RoboFile. 
➜                                                                                  
[Wed Dec 16 13:02:28.631601 2020] [mpm_prefork:notice] [pid 423] AH00173: SIGHUP received.  Attempting to restart
AH00112: Warning: DocumentRoot [/var/www/html] does not exist
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 192.168.240.3. Set the 'ServerName' directive globally to suppress this message
[Wed Dec 16 13:02:28.653932 2020] [mpm_prefork:notice] [pid 423] AH00163: Apache/2.4.38 (Debian) PHP/7.4.10 configured -- resuming normal operations
[Wed Dec 16 13:02:28.653963 2020] [core:notice] [pid 423] AH00094: Command line: 'apache2 -D FOREGROUND'

Exited with code exit status 1
CircleCI received exit code 1
juampynr commented 3 years ago

@safetypins I would start by using the "Restart job with SSH" access at CircleCI. That would allow you to jump into the environment and run commands to debug what's missing. In order to accomplish this, take the last job that failed and look for the restart button at the top right corner of the screen. Then wait for the job to run again and fail: only that this time you will find instructions at the end of the job log to jump into the environment via SSH.

By looking at the errors that you posted above, it seems that Apache is pointing to /var/www/html as the docroot but your project is somewhere else. If you manage to jump into the environment I think that you will be able to figure it out.

safetypins commented 3 years ago

I've fixed the issue I ran into above, but I've run into two other issues:

error computing cache key: template: cacheKey:1:11: executing "cacheKey" at <checksum "package.json">: error calling checksum: open /home/circleci/project/package.json: no such file or directory

and:

touch: cannot touch 'storage/testing.sqlite': No such file or directory

I think this means that the storage directory doesn't exist. But maybe I don't need to fix this error, as I think I'm going to run the tests against the platform environments. Do you know why the storage directory wouldn't exist? Do I need to mkdir?

I also saw a couple sections in my config.yml that look like:

` - restore_cache: keys:

This looks like there was an error in the setup script that resulted in an empty keys line being added. I removed these, even though they didn't appear to be causing an error. I removed them, but I'm still getting errors saving and restoring cache.

juampynr commented 3 years ago

@safetypins can you create a new issue with your current circle ci config and as much detail as you can of the errors that you are finding? That would help us to understand what is going on.