Skip to content

Commit

Permalink
Merge branch 'release/5.1.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
pingers committed Oct 5, 2021
2 parents 5cf9197 + d5130df commit 01e7000
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 35 deletions.
2 changes: 1 addition & 1 deletion scaffold/optional/docker-compose.osx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ services:
SITE_ADMIN_EMAIL: [email protected]
SITE_ADMIN_USERNAME: admin
SITE_ADMIN_PASSWORD: password
XDEBUG_CONFIG: "remote_host=docker.for.mac.localhost"
XDEBUG_CONFIG: "remote_host=host.docker.internal"
volumes:
- nfsmount:/code
- ./shared:/shared
Expand Down
2 changes: 2 additions & 0 deletions scaffold/optional/docker/.hadolint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ignored:
- DL3008
13 changes: 8 additions & 5 deletions scaffold/optional/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
# This dockerfile takes the current users uid/gid at build time and adjusts reality
# so that the running user for www-data is actually the same as the launching user.
FROM uofa/s2i-shepherd-drupal
FROM uofa/s2i-shepherd-drupal:composer2

ARG USER_ID
ARG GROUP_ID
ARG PHP_VERSION="7.4"

# Ensure shell is what we want.
SHELL ["/bin/bash", "-o", "pipefail", "-c"]

# Need to switch from www-data to root to do the change of uid
USER 0:0

Expand All @@ -31,17 +34,17 @@ fi

# Upgrade all currently installed packages and install additional packages.
RUN apt-get update \
&& apt-get -y install php-sqlite3 php-xdebug php-cli git wget sudo unzip vim \
&& apt-get -y --no-install-recommends install openssh-client php-sqlite3 php-xdebug php-cli git wget sudo unzip vim \
&& sed -ri 's/^zend.assertions\s*=\s*-1/zend.assertions = 1/g' /etc/php/${PHP_VERSION}/cli/php.ini \
&& apt-get -y autoremove && apt-get -y autoclean && apt-get clean && rm -rf /var/lib/apt/lists /tmp/* /var/tmp/*

# Blackfire
# Similar to https://blackfire.io/docs/integrations/docker/php-docker#debugging-the-php-probe
RUN version=$(php -r "echo PHP_MAJOR_VERSION.PHP_MINOR_VERSION;") \
&& wget --quiet --output-document /tmp/blackfire-probe.tar.gz https://blackfire.io/api/v1/releases/probe/php/linux/amd64/$version \
RUN version="$(php -r 'echo PHP_MAJOR_VERSION.PHP_MINOR_VERSION;')" \
&& wget -q -O /tmp/blackfire-probe.tar.gz "https://blackfire.io/api/v1/releases/probe/php/linux/amd64/$version" \
&& mkdir -p /tmp/blackfire \
&& tar zxpf /tmp/blackfire-probe.tar.gz -C /tmp/blackfire \
&& mv /tmp/blackfire/blackfire-*.so $(php -r "echo ini_get('extension_dir');")/blackfire.so \
&& mv /tmp/blackfire/blackfire-*.so "$(php -r 'echo ini_get('\''extension_dir'\'');')/blackfire.so" \
&& printf "extension=blackfire.so\nblackfire.agent_socket=tcp://127.0.0.1:8707\n" > /etc/php/${PHP_VERSION}/apache2/conf.d/blackfire.ini \
&& rm -rf /tmp/blackfire /tmp/blackfire-probe.tar.gz

Expand Down
38 changes: 9 additions & 29 deletions scaffold/required/RoboFileBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,6 @@ public function ensureDirectories() {
* Clean config and files, then install Drupal and module dependencies.
*/
public function buildInstall() {
$this->devConfigWriteable();

// @TODO: When is this really used? Automated builds - can be random values.
$successful = $this->_exec("$this->drush_cmd site:install " .
$this->getDrupalProfile() .
Expand All @@ -207,9 +205,6 @@ public function buildInstall() {
" --site-mail=\"" . $this->config['site']['mail'] . "\"")
->wasSuccessful();

// Re-set settings.php permissions.
$this->devConfigReadOnly();

$this->checkFail($successful, 'drush site:install failed.');

$this->devCacheRebuild();
Expand Down Expand Up @@ -338,6 +333,15 @@ public function configImport() {
$this->checkFail($successful, 'Config import failed.');
}

/**
* Config import backwards compatibility for restore/upgrade.
*
* @deprecated To be removed once all apps move to D9.
*/
public function configImportPlus() {
$this->configImport();
}

/**
* Exports Drupal configuration.
*
Expand Down Expand Up @@ -370,7 +374,6 @@ public function configExportOld(): void {
* Turns on twig debug mode, autoreload on and caching off.
*/
public function devTwigDebugEnable() {
$this->devConfigWriteable();
$this->taskReplaceInFile($this->services_yml)
->from('debug: false')
->to('debug: true')
Expand All @@ -384,7 +387,6 @@ public function devTwigDebugEnable() {
->to('cache: false')
->run();
$this->devAggregateAssetsDisable();
$this->devConfigReadOnly();
$this->say('Clearing Drupal cache...');
$this->devCacheRebuild();
$this->say('Done. Twig debugging has been enabled');
Expand All @@ -394,7 +396,6 @@ public function devTwigDebugEnable() {
* Turn off twig debug mode, autoreload off and caching on.
*/
public function devTwigDebugDisable() {
$this->devConfigWriteable();
$this->taskReplaceInFile($this->services_yml)
->from('debug: true')
->to('debug: false')
Expand All @@ -407,7 +408,6 @@ public function devTwigDebugDisable() {
->from('c: false')
->to('cache: true')
->run();
$this->devConfigReadOnly();
$this->say('Clearing Drupal cache...');
$this->devCacheRebuild();
$this->say('Done. Twig debugging has been disabled');
Expand Down Expand Up @@ -437,26 +437,6 @@ public function devAggregateAssetsEnable() {
$this->say('Asset Aggregation is now enabled.');
}

/**
* Make config files write-able.
*/
public function devConfigWriteable() {
$this->setPermissions("$this->application_root/sites/default/services.yml", '0664');
$this->setPermissions("$this->application_root/sites/default/settings.php", '0664');
$this->setPermissions("$this->application_root/sites/default/settings.local.php", '0664');
$this->setPermissions("$this->application_root/sites/default", '0775');
}

/**
* Make config files read only.
*/
public function devConfigReadOnly() {
$this->setPermissions("$this->application_root/sites/default/services.yml", '0444');
$this->setPermissions("$this->application_root/sites/default/settings.php", '0444');
$this->setPermissions("$this->application_root/sites/default/settings.local.php", '0444');
$this->setPermissions("$this->application_root/sites/default", '0555');
}

/**
* Imports a database, updates the admin user password and applies updates.
*
Expand Down

0 comments on commit 01e7000

Please sign in to comment.