Skip to content

dennisinteractive/drupalci

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

84 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DrupalCi

Docker build auto Docker pulls

Runs Drupal webtests and php unit tests using Docker containers. This can be used with Git webhooks but its not ready yet.

Usage examples

The parameters for the runtests.php script are:

  • --project Project or module name
  • --version Project version or branch name [optional]. The format is the same as used in Composer
  • --vcs Fork url [optional]
  • --profile  Drupal install profile [optional]
  • --patches Specifies a list of patches to be applied. See example below.
  • --dependencies List of test dependencies [optional] i.e. "drupal/link:* drupal/email:^1.0"

Drupal 9/8

Run tests from the released version of Captcha Keypad module

docker run --name drupalci --rm dennisdigital/drupalci:9-apache \
       --project captcha_keypad \
       --version ^1.0.0
docker run --name drupalci --rm dennisdigital/drupalci:8-apache \
       --project captcha_keypad \
       --version ^1.0.0

Drupal 7

docker run --name drupalci --rm dennisdigital/drupalci:7-apache \
       --project captcha_keypad \
       --version ^1.0.0

Forks and branches

To run tests from the a forked branch you can use --version with the branch. See Non feature branches. You can also specify the repository using --vcs.

docker run --name drupalci --rm dennisdigital/drupalci:8-apache \
       --project captcha_keypad \
       --version dev-8.x-1.x \
       --vcs https://github.com/dennisdigital/captcha_keypad.git

Patches

You can provide a list of patches to be applied to the project.

docker run --name drupalci --rm dennisdigital/drupalci:7-apache \
       --project amp \
       --version dev-1.x \
       --patches https://www.drupal.org/files/issues/2019-02-11/amp-initial-page-load-3031306-18.patch

For multiple patches, each Url needs to be separated by comma.

docker run --name drupalci --rm dennisdigital/drupalci:7-apache \
       --project captcha_keypad \
       --version dev-1.x \
       --patches "https://www.example.com/fix-1.patch, https://www.example.com/fix-2.patch"

Dependencies

Used to install test dependencies or any addicional package.

docker run --name drupalci --rm dennisdigital/drupalci:7-apache \
       --project amp \
       --version dev-1.x \
       --dependencies "drupal/media:* \
                       drupal/ctools:* \
                       drupal/token:* \
                       drupal/google_analytics:* \
                       drupal/dfp:* \
                       drupal/context:* \
                       drupal/adsense:*"

Checking the results

You can mount the verbose folder using -v, then you can see the generated output.

docker run -v ~/Downloads/results:/results --name drupalci --rm dennisdigital/drupalci:8-apache \
       --project sharerich \
       --version dev-1.x \
       --dependencies "drupal/token:*"

ls ~/Downloads/verbose

Using is on your project

Copy the .circleci folder into your module, remame config.yml.example to config.yml and enable Circle CI for your project. When you make commits it will automatically trigger the build an you will be able to access the verbose results via Artifacts tab on Circle CI.

This is standard Docker stuff

Building images

./build_all.sh

Building and deploying

./build_deploy_all.sh

Releases

No releases published

Packages

No packages published

Languages

  • PHP 68.2%
  • Dockerfile 21.1%
  • Shell 10.7%