From f20d9aa8aace75bdf8cc7ade057965b4d0e37d5d Mon Sep 17 00:00:00 2001 From: Marco Vermeulen Date: Mon, 21 Jan 2013 13:32:43 +0000 Subject: [PATCH] Updates to README to explain running GVM server locally. --- README.md | 46 +++++++++++++++++++++++++++++++++++++++------- 1 file changed, 39 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 1084351b..58e280b8 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ See documentation on the [GVM Project Page](http://gvmtool.net). Please report any bugs and feature request on the [GitHub Issue Tracker](https://github.com/gvmtool/gvm/issues). -Questions and disccusion at the [Nabble Forum](http://forum.gvmtool.net). +Questions and discussions at the [Nabble Forum](http://forum.gvmtool.net). ## Installation @@ -20,7 +20,10 @@ If the environment needs tweaking for GVM to be installed, the installer will pr All GVM's tests are written in Cucumber and can be found under `src/test/cucumber/gvm`. These can be run with Gradle by running the following command: - ./gradlew -i + ./gradlew + +or to see the output + ./gradlew -i __Please enusre that the JAVA_HOME environment variable set to JDK 1.7 on you system!__ @@ -30,18 +33,47 @@ Mac users can add the following line to their `~/.bash_profile` file to set this ## Running the Server locally -Ensure that you have vertx installed on your machine. +It is useful to run the server locally for development purposes. Working installations of MongoDB and vert.x are required to get going. GVM can be used to install vert.x, otherwise install it manually as described on the [install page](http://vertx.io/install.html). gvm install vert.x -To start up the server locally, simply enter: +Next, install MongoDB as described [here](http://www.mongodb.org/downloads). After installing, the database needs to be primed with some data. The following lines may be run with `mongod` running as a separate process. - vertx run build/server/server.groovy + $ mongo gvm + > db.candidates.insert({candidate:"groovy", default:"2.0.6"}) + > db.versions.insert({candidate:"groovy", version:"2.0.5", url:"http://dist.groovy.codehaus.org/distributions/groovy-binary-2.0.5.zip"}) + > db.versions.insert({candidate:"groovy", version:"2.0.6", url:"http://dist.groovy.codehaus.org/distributions/groovy-binary-2.0.6.zip"}) + +This will: + +* create a new `gvm` database +* the Groovy candidate in the `candidates` collection defaulting to version 2.0.6 +* new versions in the `versions` collection. + +Add any other candidates that you might require. + +The database may be configured in the `mongo.json` file in the root folder of the project. If no file is found, it will assume sensible defaults for a local mongodb installation. The file should be structured as follows: + + { + "address":"mongo-persistor", + "host":"host", + "port":port, + "username":"myuser", + "password":"password", + "db_name":"dbname" + } + +Next, prepare the local GVM environment by stepping into the cloned `gvm` folder, then building and starting the server. + + cd /path/to/gvm + ./gradlew + ./run.sh This will start the server on localhost:8080 -To make your GVM installation work with your local server, edit the GVM_SERVICE variable in the `~/.gvm/bin/gvm-init.sh` file as follows: +To make your local GVM installation work with your local server, run the following commands: - export GVM_SERVICE="http://localhost:8080" + ./gradlew install + source ~/.gvm/bin/gvm-init.sh