Skip to content

Instantly share code, notes, and snippets.

Last active Feb 26, 2021
What would you like to do?
Sample .tugboat/config.yml for a Drupal 8 contrib project (webform). Inspired by
image: q0rban/tugboat-drupal:8.8
default: true
http: false
depends: mysql
update: |
set -eux
# 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
# Composer is hungry. You need a Tugboat project with a pretty sizeable
# chunk of memory.
# This is an environment variable we added in the Dockerfile that
# provides the path to Drupal composer root (not the web 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 module, specifing the branch name we created
# above that uses the $TUGBOAT_REPO_ID environment variable.
composer require drupal/webform:dev-$TUGBOAT_REPO_ID -vvv
# Install Drupal on the site.
vendor/bin/drush \
--yes \
--db-url=mysql://tugboat:tugboat@mysql:3306/tugboat \
--site-name='This is a live preview' \
--account-pass=admin \
site:install standard
# 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
# Enable the module.
vendor/bin/drush --yes pm:enable webform
echo 'hi again!'
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 && git checkout -b $TUGBOAT_REPO_ID || true
composer install --optimize-autoloader
# Update this module, including all dependencies.
composer update drupal/webform --with-all-dependencies
vendor/bin/drush --yes updb
vendor/bin/drush cache:rebuild
echo 'oh hi!'
image: tugboatqa/mariadb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment