Skip to content
Snippets Groups Projects
Commit 6674e9cf authored by Frédéric G. Marand's avatar Frédéric G. Marand
Browse files

Docs update for 8.x-2.1 release.

parent 2e2bf5ee
Branches
Tags 8.x-2.1
No related merge requests found
Pipeline #32817 passed with warnings
# 2022-09-23: MongoDB doesn't support focal yet.
dist: focal
language: php
os: linux
php:
- 8.1
services: []
jobs:
allow_failures:
- php: ~
fast_finish: true
env:
global:
- MODULE_NAME='mongodb'
- MODULE_PATH="modules/contrib/$MODULE_NAME"
- BASE_URL=http://127.0.0.1:8080
- DB_NAME='travis_ci_mongodb'
- DB_URL="sqlite://localhost/test"
- COVERAGE_FILE=coverage.clover
# Relative path for coverage is relative to current directory of running
# code, not current directory launching phpunit. This means Drupal root.
- PHPUNIT_OPTS="-c core/phpunit.xml -v --debug --coverage-clover=$MODULE_PATH/$COVERAGE_FILE"
# Code coverage via coveralls.io
- COVERALLS="php-coveralls/php-coveralls:^2"
before_install:
# Ensure we have the latest packages, including SQLite and MongoDB
# - sudo echo "deb http://archive.ubuntu.com/ubuntu focal main restricted universe multiverse" >> /etc/apt/sources.list
- sudo apt-get -y update > /dev/null
- sudo apt-get -y install dirmngr gnupg apt-transport-https ca-certificates software-properties-common
# Get the MongoDB public GPG key: needs gnupg above
- wget -qO - https://www.mongodb.org/static/pgp/server-6.0.asc | sudo tee /etc/apt/trusted.gpg.d/mongodb.asc
- echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/6.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-6.0.list
- sudo apt-get -y update > /dev/null
- sudo apt-get -y install sqlite3/focal mongodb-org/focal
- sudo systemctl daemon-reload
- sudo systemctl start mongod
# Install php packages required for running a web server from drush on php 8
# - sudo apt-get install -y --force-yes php-cgi php-mysql
- sudo apt-get install -y libxml2-utils tidy
# Composer: update and add to PATH.
- sed -i '1i export PATH="$HOME/.composer/vendor/bin:$PATH"' $HOME/.bashrc
- source $HOME/.bashrc
- composer self-update --2
# Drush: 9.x prefers using a local version, so don't require it globally.
# The MongoDB extension is preinstalled but not enabled by default.
- echo "extension = mongodb.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
install:
# Install php packages required for running a web server from drush on php 8
# - sudo apt-get install -y --force-yes php-cgi php-mysql
- sudo apt-get install -y libxml2-utils tidy
# Disable XDebug for speed.
# https://github.com/travis-ci/travis-ci/issues/1697
#- phpenv config-rm xdebug.ini
# Configure PHP (mongodb is included by default).
- echo 'date.timezone = "Europe/Paris"' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
- echo "memory_limit = 4G" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
# Restore XDebug for coverage: need to back it up during removal else it won't be there to re-add.
#- phpenv config-add xdebug.ini
before_script:
# cf. https://docs.travis-ci.com/user/database-setup/#mongodb
- sleep 15
- mongosh mydb_test --eval 'db.createUser({user:"travis",pwd:"test",roles:["readWrite"]});'
# Code runs in /home/travis/build, which is the checkout root.
# Remove Xdebug as we don't need it, is slows everything, and it causes
# PHP Fatal error: Maximum function nesting level of '256' reached
#- phpenv config-rm xdebug.ini
# navigate out of module directory to prevent blown stack by recursive module lookup
- cd ../..
# download Drupal 9 core.
- wget -q -O - https://ftp.drupal.org/files/projects/drupal-9.4.x-dev.tar.gz | tar xz
- cd drupal-9.4.x-dev
- mkdir -p modules/contrib
- mv ../fgm/mongodb modules/contrib
# install dependencies (for the module) and Coveralls (for coverage) as part of the root vendors. Get rid of PHPunit < 7 and locked dependencies.
- rm -fr composer.lock vendor
- composer require -v "drush/drush:^11" "mongodb/mongodb:^1.12" "phpspec/prophecy-phpunit:^2" "phpunit/phpunit:^9.5" $COVERALLS
- composer show mongodb/mongodb
# create new site, stubbing sendmail path with true to prevent delivery errors and manually resolving drush path
- php core/scripts/drupal install testing -n
- chmod 755 sites/default
- chmod 644 sites/default/settings.php
# Define MongoDB aliases for mongodb_* submodules.
- tail --lines=+12 modules/contrib/mongodb/example.settings.local.php >> sites/default/settings.php
# Reference and enable mongodb modules in build site
#- ln -s $(readlink -e $(cd -)) drupal-9.4.x-dev/modules/custom/mongodb
- vendor/bin/drush -y en mongodb_storage mongodb_watchdog
# Needed for web tests in mongodb_watchdog.
# start a web server on port 8080, run in the background; wait for initialization.
- vendor/bin/drush runserver 127.0.0.1:8080 &
- until netstat -an 2>/dev/null | grep '8080.*LISTEN'; do true; done
script:
# Configure and run the tests
# Use explicit config filtering Drupal core from coverage report.
- cp $MODULE_PATH/core.phpunit.xml core/phpunit.xml
- export SIMPLETEST_BASE_URL="$BASE_URL"
- export SIMPLETEST_DB="$DB_URL"
- export XDEBUG_MODE="coverage"
- ./vendor/bin/phpunit $PHPUNIT_OPTS $MODULE_PATH
after_script:
- cd $MODULE_PATH
# Show the basic coverage info in log.
- xmllint --xpath "/coverage/project/metrics" $COVERAGE_FILE | tidy -xml -q --indent-attributes 1
# Report coverage to Coveralls.io, which runs from project root.
- php ../../../vendor/bin/php-coveralls --exclude-no-stmt -c .coveralls.yml -r . -x $COVERAGE_FILE -o coverage.json -vvv
# Report coverage to Scrutinizer, which runs from checkout directory.
- wget https://scrutinizer-ci.com/ocular.phar
- php ocular.phar code-coverage:upload -vvv --format=php-clover $COVERAGE_FILE
INTRODUCTION
============
MongoDB for Drupal
==================
MongoDB integration for Drupal 8.9.x and 9.x, version 8.x-2.0-dev.
MongoDB integration for Drupal 10.x, version 8.x-2.1.
[![Build Status](https://travis-ci.org/fgm/mongodb.svg?branch=8.x-2.x)](https://travis-ci.org/fgm/mongodb)
[![Coverage Status](https://coveralls.io/repos/github/fgm/mongodb/badge.svg?branch=8.x-2.x)](https://coveralls.io/github/fgm/mongodb?branch=8.x-2.x)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/fgm/mongodb/badges/quality-score.png?b=8.x-2.x)](https://scrutinizer-ci.com/g/fgm/mongodb/?branch=8.x-2.x)
This package is a collection of several modules, allowing Drupal sites to store
various data in MongoDB, either using the provided modules, or writing their own
on top of the main `mongodb` module to take .
on top of the main `mongodb` module.
| Module | Information |
|-------------------|--------------------------------------------------|
| mongodb | Drupal/Drush wrapper around mongodb-php-library. |
| mongodb_storage | Key-value storage in MongoDB. |
| mongodb_watchdog | Store logger (watchdog) messages in MongoDB. |
| Module | Information |
|-------------------|-------------------------------------------------------|
| mongodb | Drupal/Drush wrapper around mongodb-php-library. |
| mongodb_storage | Key-value storage in MongoDB.<br/>Queue API provider. |
| mongodb_watchdog | Store logger (watchdog) messages in MongoDB. |
The complete documentation is available on [Github pages].
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment