Skip to content
Snippets Groups Projects

Issue #3201358: Add live preview support

+ 59
0
 
services:
 
php:
 
image: q0rban/tugboat-drupal:8.8
 
default: true
 
http: false
 
depends: mysql
 
commands:
 
update: |
 
set -eux
 
# Increase memory limit.
 
echo "memory_limit = 3G" >> /usr/local/etc/php/conf.d/my-php.ini
 
# Check out a branch using the unique Tugboat ID for this repository, to
 
# ensure we don't clobber an existing branch.
 
git checkout -b $TUGBOAT_REPO_ID
 
# This is an environment variable we added in the Dockerfile that
 
# provides the path to Drupal composer root (not the web root).
 
cd $DRUPAL_COMPOSER_ROOT
 
# We configure the Drupal project to use the checkout of the module as a
 
# Composer package repository.
 
composer config repositories.tugboat vcs $TUGBOAT_ROOT
 
# Now we can require this theme, specifing the branch name we created
 
# above that uses the $TUGBOAT_REPO_ID environment variable.
 
composer require drupal/bootstrap:dev-$TUGBOAT_REPO_ID -vvv
 
 
# Install Drupal on the site.
 
vendor/bin/drush \
 
--yes \
 
--db-url=mysql://tugboat:tugboat@mysql:3306/tugboat \
 
--site-name=Bootstrap \
 
--account-pass=admin \
 
site:install standard
 
 
# Enable the theme.
 
vendor/bin/drush --yes theme:enable bootstrap
 
# Set the theme as default.
 
vendor/bin/drush --yes config-set system.theme default bootstrap
 
# Rebuild cache.
 
vendor/bin/drush cache:rebuild
 
 
# Set up the files directory permissions.
 
mkdir -p $DRUPAL_DOCROOT/sites/default/files
 
chgrp -R www-data $DRUPAL_DOCROOT/sites/default/files
 
chmod 2775 $DRUPAL_DOCROOT/sites/default/files
 
chmod -R g+w $DRUPAL_DOCROOT/sites/default/files
 
 
build: |
 
set -eux
 
# Delete and re-check out this branch in case this is built from a Base Preview.
 
git branch -D $TUGBOAT_REPO_ID || true
 
git checkout -b $TUGBOAT_REPO_ID || true
 
cd $DRUPAL_COMPOSER_ROOT
 
composer install --optimize-autoloader
 
# Update this module, including all dependencies.
 
composer update drupal/bootstrap --with-all-dependencies
 
vendor/bin/drush --yes updb
 
vendor/bin/drush cache:rebuild
 
 
mysql:
 
image: tugboatqa/mariadb
Loading