simplytest-8.x-4.x-dev/modules/simplytest_tugboat/templates/simplytest-tugboat-config-8-yml.html.twig
modules/simplytest_tugboat/templates/simplytest-tugboat-config-8-yml.html.twig
{#
/**
* Tugboat variables
* https://docs.tugboat.qa/reference/environment-variables/
*
* Simplytest progress status list:
* @see \Drupal\simplytest_tugboat\InstanceManager::getStatusList()
*
* Available variables:
*
* - additionals: array of additional projects to install
* - drupal_core_version: the version (branch or tag) of Drupal core to use
* - patches: array of URLs to patch files to apply
* - perform_install (bool): whether to 'drush si'
* - project: the primary project to install
* - project_type: the type (Module, Theme, or Distribution) of the primary project
* - project_version: the version string for the primary project
* - status_endpoint: The base_url + route uri + instance id for reporting
* status back to the simplytest server.
*/
#}
{% set interface = 'Drupal\\simplytest_tugboat\\InstanceManagerInterface' %}
# Drupal 8
services:
# What to call the service hosting the site.
php:
# Use PHP 7.2 with Apache
image: tugboatqa/php:7.2-apache
# Set this as the default service. This does a few things
# 1. Clones the git repository into the service container
# 2. Exposes port 80 to the Tugboat HTTP proxy
# 3. Routes requests to the preview URL to this service
default: true
depends: mysql
# A set of commands to run while building this service
commands:
# Commands that set up the basic preview infrastructure
build:
# Fetch the right drupal version.
- composer self-update
- cd "${DOCROOT}" && git config core.fileMode false
- cd "${DOCROOT}" && git fetch --all
{% set used_version = (project == 'drupal') ? project_version : drupal_core_version %}
{% if used_version ends with 'x' %}
- cd "${DOCROOT}" && git reset --hard origin/{{ used_version }}
{% else %}
- cd "${DOCROOT}" && git reset --hard {{ used_version }}
{% endif %}
# Start the downloads
- wget -O/dev/null {{ status_endpoint }}/{{ constant(interface~'::DOWNLOAD') }}
# Load drupal code base.
- composer global require szeidler/composer-patches-cli:~1.0
- cd "${DOCROOT}" && composer require cweagans/composer-patches:~1.0 --no-update
- cd "${DOCROOT}" && composer require zaporylie/composer-drupal-optimizations:^1.0 --no-update
- cd "${DOCROOT}" && composer install --no-ansi --no-dev
{% if project_type == 'Module' or project_type == 'Theme' %}
- cd "${DOCROOT}" && composer require drupal/{{ project }}:{{ project_version }} --no-update
{% endif %}
- wget -O/dev/null {{ status_endpoint }}/{{ constant(interface~'::PATCHING') }}
{% if patches is not empty %}
# Apply patches.
- cd "${DOCROOT}" && composer patch-enable --file='patches.json'
{% for patch in patches %}
- cd "${DOCROOT}" && composer patch-add drupal/{{ (project == 'drupal') ? 'core' : project }} "STM patch {{ 'now' | date('U') }}" "{{ patch }}"
{% endfor %}
{% endif %}
{% for additional in additionals %}
# Additional.
- cd "${DOCROOT}" && composer require drupal/{{ additional }} --no-update
{% endfor %}
- cd "${DOCROOT}" && composer update --no-ansi --no-dev
- cd "${DOCROOT}" && chmod -R 777 sites/default
- wget -O/dev/null {{ status_endpoint }}/{{ constant(interface~'::INSTALLING') }}
{% if perform_install %}
# Install drupal.
- drush -r "${DOCROOT}" si {{ (project_type == 'Distribution') ? project : 'standard' }} --account-name=admin --account-pass=admin -y
- cd "${DOCROOT}" && chmod -R 777 sites/default/files
{% if project_type == 'Module' or project_type == 'Theme' %}
- drush -r "${DOCROOT}" en {{ project }} -y
{% endif %}
{% for additional in additionals %}
- drush -r "${DOCROOT}" en {{ additional }} -y
{% endfor %}
{% endif %}
- wget -O/dev/null {{ status_endpoint }}/{{ constant(interface~'::FINALIZE') }}
# What to call the service hosting MySQL. This name also acts as the
# hostname to access the service by from the php service.
mysql:
# Use the latest available 5.x version of MySQL
image: tugboatqa/mysql:5
