• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

sourcemuse/GradleMongoPlugin: Gradle plugin for running a managed instance of Mo ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

sourcemuse/GradleMongoPlugin

开源软件地址(OpenSource Url):

https://github.com/sourcemuse/GradleMongoPlugin

开源编程语言(OpenSource Language):

Groovy 100.0%

开源软件介绍(OpenSource Introduction):

Gradle Mongo Plugin

Maven Central Build Status

The Gradle Mongo Plugin allows you to run a managed instance of Mongo from your gradle build.

It's available on both Maven Central and the Gradle Plugin Portal.

Usage

Enable the plugin in your gradle build:

plugins {
  id 'com.sourcemuse.mongo' version '1.0.7'
}

Hey presto, you can now declare a dependency on a running mongo instance from any of your tasks:

task integrationTest(type: Test) {
    runWithMongoDb = true
}

Configuration

Configure your Mongo instances inside a mongo block:

mongo {
    port 12345
    logging 'console'
    ...
}

The mongo configuration block can be declared at either the project or the task level. Task-level configuration inherits from any project-level configuration provided.

The following properties are configurable:

  • args: A <String,String> map of mongod command-line options (value can be empty for arguments without values) (defaults to [:])
  • artifactStorePath The location where Mongo will be downloaded to
  • auth: Enables access control (defaults to false)
  • bindIp: The ip address Mongo binds itself to (defaults to '127.0.0.1')
  • downloadUrl: The URL from where Mongo will be downloaded
  • journalingEnabled: Toggles journaling (defaults to false)
  • logFilePath: The desired log file path (defaults to 'embedded-mongo.log')
  • logging: The type of logging to be produced: 'console', 'file' or 'none' (defaults to 'file')
  • mongodVerbosity: The verbosity level of the mongod process. Supported options are as per the mongod configuration documentation (default level is non-verbose)
  • mongoVersion: The version of Mongo to run. Can be 'DEVELOPMENT' or 'PRODUCTION' for the latest versions of the respective branch, or take the form '1.2-LATEST' or '1.2.3' for specific versions
  • params: A <String,String> map of MongoDB Server Parameters (defaults to [:])
  • port: The port Mongo will listen on (defaults to 27017). For random port assignment, set this value to 'RANDOM' (the actual port value used will be available during the build through the project.mongo.port property)
  • proxyHost: The proxy host name for Mongo downloads
  • proxyPort: The proxy port for Mongo downloads
  • storageEngine: The name of the storage engine to use. Can be 'wiredTiger' or 'mmapv1' for MongoDB Community Edition (default is 'wiredTiger' for Mongo 3.2 and later; otherwise it is 'mmapv1'). Alternative distributions might support additional engines
  • storageLocation: The directory location from where embedded Mongo will run, such as /tmp/storage (defaults to a java temp directory)
  • syncDelay: The interval in seconds between fsync operations where mongod flushes its working memory to disk. See syncdelay parameter for more information

Tasks

For your convenience the plugin also adds the following tasks to your buildscript:

$ gradle tasks
...
Mongo tasks
-----------
startManagedMongoDb - Starts a local MongoDb instance which will stop when the build process completes
startMongoDb - Starts a local MongoDb instance
stopMongoDb - Stops the local MongoDb instance
...



鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap