Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mongodb
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
mongodb
Commits
6674e9cf
Commit
6674e9cf
authored
1 year ago
by
Frédéric G. Marand
Browse files
Options
Downloads
Patches
Plain Diff
Docs update for 8.x-2.1 release.
parent
2e2bf5ee
Branches
Branches containing commit
Tags
8.x-2.1
No related merge requests found
Pipeline
#32817
passed with warnings
1 year ago
Stage: build
Stage: validate
Stage: test
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.travis.yml
+0
-137
0 additions, 137 deletions
.travis.yml
README.md
+9
-11
9 additions, 11 deletions
README.md
with
9 additions
and
148 deletions
.travis.yml
deleted
100644 → 0
+
0
−
137
View file @
2e2bf5ee
# 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
This diff is collapsed.
Click to expand it.
README.md
+
9
−
11
View file @
6674e9cf
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
.
[

](https://travis-ci.org/fgm/mongodb)
[

](https://coveralls.io/github/fgm/mongodb?branch=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].
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment