All Projects → Lullabot → Drupal8ci

Lullabot / Drupal8ci

Licence: gpl-3.0
One-line installers for implementing Continuous Integration in Drupal 8

Programming Languages

shell
77523 projects

Projects that are alternatives of or similar to Drupal8ci

drupal9ci
One-line installers for implementing Continuous Integration in Drupal 9
Stars: ✭ 137 (+21.24%)
Mutual labels:  workflow, circleci, drupal, continuous-integration
fabalicious
is now deprecated and not supported anymore, use https://github.com/factorial-io/phabalicious instead
Stars: ✭ 14 (-87.61%)
Mutual labels:  drupal, continuous-integration
drupal-circleci-behat
Test and deploy Drupal 9 with CircleCI 2.0 and Behat 3
Stars: ✭ 17 (-84.96%)
Mutual labels:  circleci, drupal
drevops
💧 + 🐳 + ✓✓✓ + 🤖 + ❤️ Build, Test, Deploy scripts for Drupal using Docker and CI/CD
Stars: ✭ 55 (-51.33%)
Mutual labels:  drupal, continuous-integration
Norimaki
🌀 Android client for Circle CI
Stars: ✭ 19 (-83.19%)
Mutual labels:  circleci, continuous-integration
tiller-circleci
Deploy Trellis, Bedrock and Sage via CircleCI
Stars: ✭ 14 (-87.61%)
Mutual labels:  circleci, continuous-integration
koshry
Run on CI, Apply Rules on the Build and Get the Result back to the Pull Request.
Stars: ✭ 59 (-47.79%)
Mutual labels:  circleci, continuous-integration
Tox
Command line driven CI frontend and development task automation tool.
Stars: ✭ 2,523 (+2132.74%)
Mutual labels:  continuous-integration, circleci
Circleci Cli
Use CircleCI from the command line
Stars: ✭ 297 (+162.83%)
Mutual labels:  continuous-integration, circleci
myrepo
continuous integration rep
Stars: ✭ 41 (-63.72%)
Mutual labels:  circleci, continuous-integration
Grunt Drupal Tasks
Grunt-based build and testing tasks for Drupal
Stars: ✭ 125 (+10.62%)
Mutual labels:  drupal, workflow
Cyclone
Powerful workflow engine and end-to-end pipeline solutions implemented with native Kubernetes resources. https://cyclone.dev
Stars: ✭ 978 (+765.49%)
Mutual labels:  workflow, continuous-integration
Wflow
🐆 EXPERIMENTAL -- Runs GitHub Actions workflows locally (local) -- Don't run your YAML like a 🐪
Stars: ✭ 187 (+65.49%)
Mutual labels:  workflow, continuous-integration
scikit-ci
Simpler and centralized CI configuration for Python extensions.
Stars: ✭ 15 (-86.73%)
Mutual labels:  circleci, continuous-integration
Rok8s Scripts
Opinionated scripts for managing application deployment lifecycle in Kubernetes
Stars: ✭ 248 (+119.47%)
Mutual labels:  continuous-integration, circleci
developer-ci-benefits
Talk docs—includes CI (Continuous Integration) benefits, description, and setup tips 💡💪
Stars: ✭ 29 (-74.34%)
Mutual labels:  circleci, continuous-integration
Nevergreen
🐤 A build monitor with attitude
Stars: ✭ 170 (+50.44%)
Mutual labels:  continuous-integration, circleci
Env Ci
Get environment variables exposed by CI services
Stars: ✭ 180 (+59.29%)
Mutual labels:  continuous-integration, circleci
ci2go
CI2Go is a @circleci client for iPhone, iPad, Apple Watch and Mac.
Stars: ✭ 87 (-23.01%)
Mutual labels:  circleci, continuous-integration
Circleci Images
Scripts to generate images for building projects on CircleCI 2.0
Stars: ✭ 397 (+251.33%)
Mutual labels:  continuous-integration, circleci

Drupal 8 CI

CircleCI

This repository provides the foundation to implement Continuous Integration in a Drupal 8 project using any of the following CI providers:

To install, simply run the respective installer and allow the CI provider that you chose to watch repository changes to start building on every pull request.

If you want to test an individual module instead of a Drupal project, see Andrew Berry's drupal_tests.

Here is a clip that shows how it works for CircleCI.

Requirements

The scripts assume that you have a Drupal 8 project created using drupal-project, which sets a well known foundation. If your project's directory structure differs from what drupal-project sets up, you will need to adjust the CI scripts.

It's also recommended to adjust your project to add a subset of the settings.php file into version control and rely on settings.local.php for setting the database connection. See this commit which contains these changes among other ones. The CI scripts have their own settings.local.php which is copied at build time into web/sites/default.

Installation

Each CI tool has its own installer, which extracts the required files to run the jobs. It also adds a demo module with tests.

Choose a CI tool from the list below and follow its installation steps.

CircleCI

Demo repository | Deep dive article

Open a terminal and run the installer from the root of your project:

curl -L https://github.com/lullabot/drupal8ci/raw/master/setup-circleci.sh | bash

Sign up at CircleCI and allow access to your project's repository.

CircleCI watch

Happy CI-ing! :-D. From now every time you create a pull request, CircleCI will run the set of jobs and report their result like in the following screenshot:

CircleCI pull request

For an overview of the CircleCI features, have a look at this article from the Lullabot blog.

Using a custom Docker image

The CircleCI configuration file uses a custom Docker image that extends from the official Drupal image and it is hosted at Docker Hub. If this image does not fit your project's architecture, then have a look at its Dockerfile and consider creating your own image based out of it.

Setting up the update path

The Behat job requires a running Drupal 8 site. The repository contains the code, but for running tests in a realistic environment you need:

1. A recent copy of the production environment's database

If you have Drush site aliases, then at the CircleCI dashboard go to the project's permissions and add an SSH key. Next, add drush @my.alias sql-cli to the Behat job at .circleci/config.yml.

Alternatively, upload a sanitized database dump somewhere. For example the demo project uses a Dropbox URL via an environment variable which is set at the Circle CI web interface like in the following screenshot:

CircleCI database via environment variable

2. The production environment's files directory

If you have a site alias, then add drush rsync @my.alias @self to the Behat job. Alternatively, use Stage File Proxy module.

Travis CI

Demo repository | Deep dive article

Open a terminal and run the installer from the root of your project:

curl -L https://github.com/lullabot/drupal8ci/raw/master/setup-travis-ci.sh | bash

Sign up at Travis CI and allow access to your project's repository:

Travis watch

Happy CI-ing! :-D. From now on every pull request will trigger a build in Travis and its progress will be visible like in the following screenshot:

Travis pull request

For you to see the result of the individual jobs, you need to click at the Details link from the above screenshot:

Travis CI jobs

Setting up code coverage reports

Coveralls.io is a third party tool that can host and present PHPUnit code coverage reports in a neat way within a pull request. Here is how to set it up:

Register at https://coveralls.io using your GitHub account and then add your repository like in the following screenshot:

Coveralls add repository

Then take the chance to adjust a couple settings to get cleaner feedback in pull requests:

Coveralls settings

That's it! Here is a sample report which you can see by clicking at Details at the pull request's status message:

Coveralls report

Setting up the Behat job

The Behat job requires, in order to test the behavior of your project:

1. A recent copy of the production environment's database

If you have Drush site aliases, and your repository is private, then follow these instructions to add an SSH key. Next, set up a drush site alias. Finally, adjust the Behat job to run drush @my.alias sql-cli.

Alternatively, upload a sanitized database dump somewhere and set up the environment variable so the job can download it. For example the demo project uses a Dropbox URL via an environment variable referenced below:

Travis CI db env var

2. The production environment's files directory

If you have a site alias, then add drush rsync @my.alias @self to the Behat job. Alternatively, use Stage File Proxy module.

GitLab CI

Demo repository | Deep dive article

Open a terminal and run the installer from the root of your project:

curl -L https://github.com/lullabot/drupal8ci/raw/master/setup-gitlab-ci.sh | bash

Review, commit, and push the resulting changes. After doing that, navigate to the project's homepage at GitLab and open the CI / CD >> Pipelines section. You should see a running pipeline like the following one:

GitLab pipeline

Database setup

In order to build a Docker image with your project's database. Run the one-line installer mentioned above and then follow the instructions at the resulting scripts/database directory in your local environment.

Troubleshooting

Class "\Drupal\Tests\Listeners\DrupalStandardsListener" does not exist

If you get this error at the unit and kernel tests jobs, then it means that your project uses Drupal 8.5 or newer, which introduced a few changes at web/core/phpunit.xml.dist.

To fix this, overwrite .circleci/config/phpunit.xml with .circleci/config/phpunit-drupal-8.5.xml if you are using CircleCI, or with .travis/config/phpunit-drupal-8.5.xml if you are using Travis CI.

GitHub Actions

Demo repository

Open a terminal and run the installer from the root of your project:

curl -L https://github.com/lullabot/drupal8ci/raw/master/setup-github-actions.sh | bash

Review, commit, and push the resulting changes. After doing that, navigate to the repository's homepage at GitHub and open the Actions tab. You should see a running workflow like the following one:

GitLab pipeline

Database setup

In order to build a Docker image with your project's database. Run the one-line installer mentioned above and then follow the instructions at the resulting scripts/database directory in your local environment.

Troubleshooting

Class "\Drupal\Tests\Listeners\DrupalStandardsListener" does not exist

If you get this error at the unit and kernel tests jobs, then it means that your project uses Drupal 8.5 or newer, which introduced a few changes at web/core/phpunit.xml.dist.

To fix this, overwrite .circleci/config/phpunit.xml with .circleci/config/phpunit-drupal-8.5.xml if you are using CircleCI, or with .travis/config/phpunit-drupal-8.5.xml if you are using Travis CI.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].