What needs to be done so that we can publish official CiviCRM-Drupal8 tarballs?
"So I still think that it will be at least a two stage process....one is the drupal module...you could have that downloadable from civicrm.org, but to be compliant with Drupal standards, it would also be nice for the civicrm project page to have the d8 drupal module" -- @jackrabbithanna
"What we're missing infrastructure wise, is the build process to a composer package that puts civicrm-core and civicrm-packages together as per that gist" -- @jackrabbithanna
"A one-step drupal 8 composer install for D8 seems to be where we should end up." @MikeyMJCO
"yep their could be a composer.json int he drupal module that requires the combined civicrm-core + civicrm-packages .. OR people could download the module and run the composer require independently, and place it in the right place" [...] "that all will get itself sorted pretty quick once the gist steps are available from one composer require" -- @jackrabbithanna
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Child items ...
Show closed items
Linked items 0
Link issues together to show that they're related.
Learn more.
we could produce a .tar.gz of the vendor/civicrm/civicrm-core directory, that, if published correctly (in a way for composer to find it), people could composer require it
but they would still need to install modules/civicrm-drupal-8 separately.
So we could include a "dist" URL in the composer.json, but that dist URL would be d8-only. Might be a problem for cross-CMS compatibility? Although the resulting tar.gz might work for WordPress too, because some CMS-specific code was removed from core.
These are the current steps...there's nothing in here but getting the civicrm packages and other things and putting them in the proper places in the vendor/civicrm/civicrm-core folder, and one bower install command
and this:
cat /tmp/civicrm/civicrm-version.php | sed -e 's/Drupal/Drupal8/' > vendor/civicrm/civicrm-core/civicrm-version.php
Which I think there has been a PR for this already?
So the process can be:
Download and install Drupal 8
Go into the root directory in the shell and run composer require civicrm/civicrm-core (or civicrm-core-d8, or civicrm-core-packages, or whatever the community wants to settle on)
If you use Apache, remove the vendor/.htacess file. This is a security measure from Drupal, which prevents resources like CSS/JS being loaded. This will need some collaboration with the Drupal project to figure out a proper solution for because removing this file altogether is a bad idea on production. See: https://www.drupal.org/node/2896308 (link is external) Use Nginx preferably!
Go into the /modules directory and do: git clone git@github.com:civicrm/civicrm-drupal-8.git civicrm OR just download the stable release from civicrm.org or D.O project page and place in /modules
Go to the "Extend" page (at /admin/modules) and install the CiviCRM module
CiviCRM works!
Call that an "official release install method" phase 1
Additionally, we may add this composer require statement to the Drupal module composer.json, for those people wanting to install D8 and D8 modules with composer, although that takes a little extra love to work...
People had been having to symlink to the vendor directory outside the webroot, from the vendor inside the webroot..
From that list, all of those open issues are indeed important, but only drupal#7 (closed) seems like a high priority to me. It's almost ready to merge. If we can fix that, I think we can start working on distmaker?
@jackrabbithanna It sounds like you're loading your CSS/JS assets from the vendor folder, as per the docs @dsnopek so helpfully maintains.
I had worked with this configuration - with vendor symlinked in the webroot and trying other tricks - but the process fell over once I needed to use scripts in the extern folder. They can't bootstrap Civi if they're in the vendor folder, and I need me my REST APIs.
In drupal#9 (closed)@totten outlines the steps used by the Roundearth distribution, which I found to work much better, and bypasses the need to figure out how to deal with the security implications of removing the .htaccess file from the vendor directory. I also assume that since this is also maintained by @dsnopek it represents a newer way of thinking on how to package the stable D8.
I'd love to hear feedback from folks on this, because ideally our current D8 sites should mirror the eventual packaged D8.
The .htaccess issue is not a big one for people using nginx.
Is the Roundearth way superior, in that you could install CiviCRM via composer and make use of the scripts in the extern folder?
This would also apply to payment processor webhooks? To use stripe or some other pp for recurring contributions, it must definitely be setup in a similar fashion?
If the Roundearth way of packaging Civi is better, should it be the official way, and that way outlined here as the common goal?
There are two options for installing D8, with or without composer...So it's possible we'll need two official ways? IDK the answer to that question.
I think that without centralized leadership on this issue soon there will be 10 "unofficial" ways, and the marketing of D8 + Civi will be done by partners and organizations, and not by the LLC at all. I can imagine any number of us making our own Civi+D8 distros, and there will be no one place to go to find your way with D8/D9 + Civi, we can all compete on the packaging and marketing, and we all start to loose the collective identity and branding, and resource pooling, at least in the Drupal realm. Sounds very free market, so maybe that is the way it should be. Not making a decision, is still a decision!
"This would also apply to payment processor webhooks? To use stripe or some other pp for recurring contributions, it must definitely be setup in a similar fashion?"
Payment Processors now use /civicrm/ipn, not the extern scripts, so not affected.
In drupal#9 (closed)@totten outlines the steps used by the Roundearth distribution, which I found to work much better, and bypasses the need to figure out how to deal with the security implications of removing the .htaccess file from the vendor directory. I also assume that since this is also maintained by @dsnopek it represents a newer way of thinking on how to package the stable D8.
In Roundearth, we use a bash script to copy the necessary web-accessible files from vendor into /library/civicrm. However, I think this could (and should!) be converted to composer script that could be included in CiviCRM, so that others can easily use it in a composer-based workflow. (It should also be improved to optionally allow symlinking instead of copying, so that platforms/configurations that allow that can save the disk space.)
It is definitely superior to making the whole vendor directory web-accessible, since that is a security risk - one that has bit Drupal over and over again since the release of Drupal 8. And, it does also allow the extern/ scripts to work, but I'm happy to see those being progressively deprecated. :-)
In Roundearth, we use a bash script to copy the necessary web-accessible files from vendor into /library/civicrm. However, I think this could (and should!) be converted to composer script that could be included in CiviCRM, so that others can easily use it in a composer-based workflow. (It should also be improved to optionally allow symlinking instead of copying, so that platforms/configurations that allow that can save the disk space.)
Can we use that bash script in composer as-is?
A script, in Composer's terms, can either be a PHP callback (defined as a static method) or any command-line executable command. Scripts are useful for executing a package's custom code or package-specific commands during the Composer execution process.
From:https://getcomposer.org/doc/articles/scripts.md
However, I think it'd be better converted to PHP, because then it'll work on any platform that supports composer (including Windows, for example), and doesn't depend on having certain CLI tools installed (ie. rsync which is used by the current script).
So, returning to the original topic of this issue (skipping all the discussion above): I don't know that a tarball release makes sense for Drupal 8 -- CiviCRM needs to be installed via Composer, and there just isn't a clean way around that.
Having a template for composer create-project can help people without an existing site to get started quickly, for example: