drupalwxt / docker-scaffold

Docker Scaffold for Drupal WxT
4 stars 7 forks source link

WxT 4.4.0 fails to build. #22

Closed liquidcms closed 1 year ago

liquidcms commented 1 year ago

Not sure if this is a scaffold issue; but guessing it is.

We have recently upgraded to WxT 4.4.0 and the upgrade went surprisingly well. Local devs have site up and running both in a native environment (apache/mysql/etc running natively) as well as in a docker container.

But our github action to build no longer works. It fails in the build script that comes from docker-scaffold. It fails at nearly the last line:

RUN chown -R www-data:www-data sites/default

due to that folder not being there.

If i comment out that line then the build script completes and the image is available. Looking at the image and sure enough that folder (and some other files/folders) are not there.

Flipping back to WxT 4.3.4 and build works fine.

We have been running off a forked version of this repo and a branch off the 9.1.x branch (possibly). But i switched back to use this repo and running off the 9.4.x branch and build still fails at the same point.

Any thoughts on how WxT 4.4.x is tied to a specific version of the scaffold and what could be causing what seems like a failure to create folders?

smulvih2 commented 1 year ago

Are you able to provide logs? The sites/default folder should be created on line 92 on composer install. Maybe the issue is with your composer?

liquidcms commented 1 year ago

My composer? I think the scaffold installs composer so i suspect it's whatever version is defined there. Which is 2.3.5.

Line 92 is simply running composer; can you be more specific where those are built? I don't see it in any of the script files in the WxT composer.json.

again, this all worked 3 days ago before upgrading to WxT 4.4.0.

liquidcms commented 1 year ago

Another odd thing which makes me think this is related to something no longer knowing base folder: I have a folder in composer root folder called patches; with local patch files. This now fails to be found when doing scaffold build script. Running composer manually in native host system or within docker container and they are visible.

So I removed the local patches to get past composer - and then fails at chown command i mentioned.

Our forked version of scaffold is able to see the local patches folder but fails on the chown.

smulvih2 commented 1 year ago

On line 85/86 the Dockerfile copies your project's composer.json and composer.lock file into the image, then runs composer install, which should create the folder /var/www/html/sites/default. If you are able to provide your logs for the GitHub action it might provide some more info.

Your local patches are probably not being pulled into the image. You will need to add a COPY command to bring it into the image, same way as the Dockerfile copies the custom theme and module folders. I had to do this for the 9.4.x-postgres branch to copy the /config/sync folder to allow config management to work with images.

liquidcms commented 1 year ago

nvm patches issue.. i see we have this in our forked version of scaffold

Copy local patches folder from repo to www folder

COPY patches/ /var/www/patches/

so i think question is where is the Drupal file structure being built out? That folder is part of our wxt repo though.. so wondering why it isnt included with rest of repo.. which is maybe also missing?? checking now

liquidcms commented 1 year ago

"which should create the folder /var/www/html/sites/default. " there is nothing directly in composer which does this (never was); perhaps in a script that is run by composer? The issue is none of the wxt repo is here and is not installed through composer.. sort of going in circles here. The wxt repo is cloned, then the scaffold repo is cloned; the scaffold build script runs to build docker img but i dont see where it copies over parent root folder (i.e. wxt repo).. so everything is missing (in container built from build script) except what is built from composer.

it seems like there needs to be a line to copy over the repo folders the same way as i do with the patches folder or, the wxt composer/json needs to require itself.

github build log attached. logs_6212.zip

liquidcms commented 1 year ago

core-composer-scaffold missing from root composer.json.

smulvih2 commented 1 year ago

The root composer.json file should require drupalwxt/wxt, which itself requires drupal/core. Drupal core comes with the /sites/default directory - https://git.drupalcode.org/project/drupal/-/tree/9.4.x/sites/default

So, by copying composer.lock into the image and running composer install, you should see /var/www/html/sites/default. This leads me to believe your issue is with composer. I can look at the logs you provided after the weekend to see if anything jumps out.

smulvih2 commented 1 year ago

Ahh ok, ya missing drupal/core-composer-scaffold is probably the cause since it won't put core stuff in the correct place.

liquidcms commented 1 year ago

Wonder if this should not be in the wxt require section of their composer.json rather than the require-dev section?

liquidcms commented 1 year ago

I guess if the default Drupal install flow using create-project is used, and then require wxt; then things would mostly work. Although this is not what the wxt installation guide suggests (which i don't think works) and if the std drupal and then require wxt approach is taken; then I get a wrong version of bower error.

smulvih2 commented 1 year ago

Closing this issue since WxT 4.4.0 does build correctly. If other issues exist please create a new ticket.