Skip to content
This repository has been archived by the owner on Jan 13, 2023. It is now read-only.

Build initial Drupal 8 codebase if not present #104

Closed
geerlingguy opened this issue May 30, 2018 · 9 comments
Closed

Build initial Drupal 8 codebase if not present #104

geerlingguy opened this issue May 30, 2018 · 9 comments

Comments

@geerlingguy
Copy link
Owner

So, right now the Kubernetes branch is using the drupal repository, which includes a copy of the Drupal codebase, but is not specifically intended for production usage (though it could be hacked around to do so...).

One annoying side effect is that on every reboot or Pod replacement of the drupal8 service, we end up with a codebase divorced from the database!

So, instead, I'd like to:

  • See if a Drupal container image has been built already.
  • Build one if not (or use a decent one off Docker Hub... Wodby maybe?)
  • See if we have an existing Drupal codebase.
  • If not, build a Drupal codebase using Drupal Project.
  • See if we have an existing Drupal installation.
  • If not, install Drupal.

For all of these steps, they should happen after Kubernetes is started and stabilized.

I haven't yet decided if I want to just host a separate Git repo with the Drupal codebase in it on GitHub, so I don't have to rebuild it forever and ever for testing purposes... it's kind of annoying and takes a bit of time. But it might be better for educational purposes anyways :/

@geerlingguy geerlingguy changed the title K8s: Build Drupal 8 codebase and initial container if not present Build Drupal 8 codebase and initial container if not present May 30, 2018
@geerlingguy
Copy link
Owner Author

New docker image for building off of: https://hub.docker.com/r/geerlingguy/drupal/

@geerlingguy
Copy link
Owner Author

Opened #108 as a likely prerequisite.

Also doing a bit more (quicker) testing in #107. Easier than reprovisioning all the Pis each time :)

@geerlingguy
Copy link
Owner Author

geerlingguy commented Jun 5, 2018

D'oh, I could just recommend people set the environment vars in settings.php instead, e.g.:

How to Use Environment Variables for your Drupal Settings with Docksal. Code example:

$databases['default']['default'] = [
  'driver' => 'mysql',
  'database' => getenv('DRUPAL_DATABASE'),
  'username' => getenv('DRUPAL_DATABASE_USER'),
  'password' => getenv('DRUPAL_DATABASE_PASSWORD'),
  'host' => getenv('DRUPAL_DATABASE_HOST'),
];

@geerlingguy
Copy link
Owner Author

As part of geerlingguy/drupal-container#3, I'm adding a 'download Drupal core if it's not already present' feature to the entrypoint.

@geerlingguy
Copy link
Owner Author

Blocked by two things:

  1. Create an NFS mount for the drupal8 files directory #110 (NFS mount for files directory)
  2. settings.php file and permissions for first install... we should really build the codebase in a new container once before setting up the services/deployments.

@geerlingguy
Copy link
Owner Author

Worked on #2 above... we'll see if that works.

@geerlingguy
Copy link
Owner Author

Was having a 'fun' time debugging why kubectl couldn't do logs on a pod that was running on a separate node from master, and found another place where I need to be more explicit about the IP/interface to listen on for Vagrant-based multi-node architectures.

Posted follow-up comment in kubernetes/kubernetes#60835 (comment) to help if I run into this in the future :)

@geerlingguy
Copy link
Owner Author

One good thing... I can confirm that even if you blow away the drupal8 and drupal8-mysql deployments/services entirely, the database is still intact, and you can get right back into things by just bringing the services back up. Nice work, PVs!

@geerlingguy geerlingguy changed the title Build Drupal 8 codebase and initial container if not present Build initial Drupal 8 codebase if not present Jun 9, 2018
@geerlingguy
Copy link
Owner Author

Fixed via above commit.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant