2

We are using git, composer, and are currently implementing DDEV for automated TYPO3 CMS deployment. But there are some manual processes that I don't know how to automate?

  1. How can we automate adding or removing of "Include static (from extension)"? Currently this is a manual process under the Includes tab of the main TS template.
  2. How do we handle activate/deactivate for extensions? PackageStates.php is where TYPO3 keeps track of what extensions are installed, so should PackageStates.php be tracked in git or should all extensions that exist in the ext and sysext folders be installed and entirely remove those we don't want as Helmut Hummel was suggesting he's already doing?
  3. How can we automate the custom configuration settings for each extension that are typically set by going to Extensions in the TYPO3 CMS backend and then selecting a particular extension?
god_is_love
  • 571
  • 5
  • 18

3 Answers3

2

Here are some suggestions:

  1. You can at least avoid the roundtrip through the TYPO3 backend by simply adding the desired contants/setup file to your site extension via INCLUDE_TYPOSCRIPT. It's not automated but ensures an atomic change and easy removal without clicking around. Of course, you need to have a single INCLUDE_TYPOSCRIPT in the contants and setup field of your template record in the backend pointing to your site extension.
  2. I strongly recommend the approach Helmut has established here: simply only require the packages you really need. If you add the TYPO3 Console command install:generatepackagestates as post-autoload-dump script, you can have the PackageStates.php updated automatically. Most of the time you don't even need to add this file to your repository anymore if you do this step on deploy too.
  3. These configuration settings end up in $GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf'] as serialized string so you can simply set this as desired, unserializing existing configuration before if necessary. You can do this in your AdditionalConfiguration.php to keep the code on configuration changes. Notice that $GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf'] is deprecated with TYPO3v9 and replaced by a plain array and a proper API.
Mathias Brodala
  • 5,905
  • 13
  • 30
1
  1. To "Include Static" you always have to perform changes in database. The added templates are saved in sys_template table. So you can create a sh script to import only this table on each deploy.

  2. You can add the PackageStates in git if you are not using composer to install the extensions. I'm doing in this way when i'm not using composer for extensions.

  3. Please check this link https://docs.typo3.org/typo3cms/CoreApiReference/ExtensionArchitecture/ConfigurationOptions/Index.html

Andrei Todorut
  • 4,260
  • 2
  • 17
  • 28
1

Regarding 1.) you can use the hook `$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['Core/TypoScript/TemplateService']['runThroughTemplatesPostProcessing']. as an example, take a look at https://github.com/CMSExperts/bolt/blob/master/Classes/TypoScript/TemplateService.php

Georg Ringer
  • 7,779
  • 1
  • 16
  • 34