Skip to content
Tommy Barker edited this page Sep 1, 2013 · 16 revisions

Most MetriDoc projects consist of a job and optionally some kind of view. The jobs are written in groovy and ran by the MetriDoc command line interface or with straight groovy, while the views are grails plugins. Sometimes very complex or legacy jobs might be written in the grails framework, but most of the time they are written in straight groovy. To get started, all you need is Java and some database to store the data you are trying to migrate. MetriDoc has been tested on MySql in production and H2 during testing; millage may vary if its used on other databases. Although visualizing the data is not MetriDoc's primary focus, some tooling is built around grails to do some very basic web based reporting if you want to. In general MetriDoc tries to help with integrating data, but doesn't try to make any assumptions about how a user wants to look at it.

MetriDoc Command Line

The quickest way to get started is with the command line interface. If you have access to a bash enabled terminal, you can call curl -s https://raw.github.com/metridoc/metridoc-job-cli/master/src/etc/install-mdoc.sh | sh. This will download and install the command line utility under HOME/.metridoc/cli. Going forward, you can use this script to upgrade metridoc as well. So instead of coming here to copy and paste the curl command, you could put the following into you .bash_profile

function upgradeMetridoc {
	curl -s https://raw.github.com/metridoc/metridoc-job-cli/master/src/etc/install-mdoc.sh | sh
}

If you would prefer to use the binary, you can download the binary distribution from bintray here or build the project directly. To build the command line utility, issue the following commands:

git clone https://github.com/metridoc/metridoc-job-cli.git
cd metridoc-job-cli
./gradlew installApp

After running these steps, the command line utility will be available in build/install/mdoc. Set your PATH variable to build/install/mdoc/bin and you will be ready to go.

To make sure mdoc is working simply type mdoc on the command line. You should get some usage information.

Running a Script

mdoc is nothing more than a groovy wrapper with some extra libraries. So anything you can do in groovy you can do in with mdoc. Therefore the simplest hello world script would be println "Hello World". Assuming you put this into the file hello.groovy, you could run mdoc hello.groovy.