Skip to content

bzacar/mongeez

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status Maven Central Known Vulnerabilities Codacy Badge

Note: This is a fork of mongeez

It uses a different maven groupId.

<dependency>
    <groupId>com.github.bzacar</groupId>
    <artifactId>mongeez</artifactId>
</dependency>

This fork has five basic differences from the original repository:

  1. All MongoDB java drivers are updated and all deprecated API uses are removed.

  2. utils option: A new option added to change sets to use util scripts. Util scripts are defined like any other change set and in mongeez.xml files they should be defined with util tag (instead of file tag used for normal change sets). It can be used to define multiple util change files to be used with the given change set. Example change set definition to use util script:

    XML:

    <changeSet changeId="ChangeSet-Using-Single-Util" author="bzacar" utils="util1.xml"/>
    <changeSet changeId="ChangeSet-Using-Multiple-Util" author="bzacar" utils="util1.xml,util2.js"/>

    JS:

    //changeset bzacar:ChangeSet-Using-Single-Util utils:util1.xml
    //changeset bzacar:ChangeSet-Using-Multiple-Util utils:util1.xml,util2.js

    Example mongeez.xml which defines util scripts:

    <changeFiles>
      <file path="changeset_using_util.xml"/>
      <util path="util1.xml"/>
      <util path="util2.js"/>
    </changeFiles>

    Change sets which uses utils option will be run together with util scripts referenced in that option. Util scripts will be loaded in the order they are defined in the option.

  3. useMongoShell option: This option can be used in order to force the library to use mongo shell to run the change sets instead of using db.eval so that you don't need to create a special user in the database to execute db.eval commands. The drawback of this option is that it requires mongo shell to be install on the machine that will run the change sets. The option can be activated as mongeez.setUseMongoShell(true).

  4. Dry Run option: You can now execute a dry run with mongeez. To use dry run you need to call mongeez.dryRun() instead of mongeez.process(). This new methods returns a nullable string and list of strings pair. Nullable string part contains summary information about the last change set run on the database. If there is no change set run on the database yet that string will be null. The list contains summary information about the change sets that would have been run on the database if that was not a dry run. All summary information are in the format: <author of the change set>:<id if the change set>:<if available resource path of the file otherwise file name>

  5. Command line interface tool: This is explain in following sections, CLI

What is mongeez?

mongeez allows you to manage changes of your mongo documents and propagate these changes in sync with your code changes when you perform deployments.

For further information and usage guidelines check out the wiki.

Join the user group

http://groups.google.com/group/mongeez-users

Become a contributor

http://groups.google.com/group/mongeez-dev

Add mongeez to your project

<dependency>
    <groupId>org.mongeez</groupId>
	<artifactId>mongeez</artifactId>
	<version>0.9.6</version>
</dependency>

Maven repo for releases - http://repo1.maven.org/maven2

Internal versions - https://oss.sonatype.org/content/groups/public

Or download mongeez from

repo1.maven.org - http://repo1.maven.org/maven2/org/mongeez/mongeez

Travis Continuous Integration Build Status

Hopefully this thing is routinely green. Travis-CI monitors new code to this project and tests it on a variety of JDKs.

Command Line Interface Tool

This fork also includes a command line interface tool which uses mongeez to execute change sets on the database. You can download the tarball from maven repository with this link.

You can also add it as a dependency to your projects:

<dependency>
    <groupId>com.github.bzacar</groupId>
    <artifactId>mongeez-cli</artifactId>
    <type>tar.gz</type>
    <classifier>dist</classifier>
    <exclusions>
        <exclusion>
            <groupId>com.github.bzacar</groupId>
            <artifactId>mongeez</artifactId>
        </exclusion>
    </exclusions>
</dependency>

The tarball contains two files:

  • Jar file of the tool
  • Shell script to run the tool

You can run the tool with help option to see what parameters you can provide and what are the default values of those parameters:

./mongeez-cli.sh --help

License

Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0

About

MongoDB Easy Change Management

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Kotlin 94.8%
  • JavaScript 5.1%
  • Shell 0.1%