diff --git a/.travis.yml b/.travis.yml index 56d8c34..19e70e8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,12 +3,16 @@ scala: - 2.11.7 after_success: - - bash deploy-baked-donut.sh + - if [ "$TRAVIS_BRANCH" == "master" ]; then + bash deploy-baked-donut.sh +cache: + directories: + - /root/.ivy2/cache/ env: global: - ENCRYPTION_LABEL: "e95fb731c984" - COMMIT_AUTHOR_EMAIL: "chdask@gmail.com" notifications: - slack: magentys:hTBVaA9gGjBPhW5OAqnMwePI \ No newline at end of file + slack: magentys:hTBVaA9gGjBPhW5OAqnMwePI diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..591ff73 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,10 @@ +FROM openjdk:9 +LABEL maintainer="tim.myerscough@mechanicalrock.io" + +ENV DONUT_VERSION 1.0 + +WORKDIR /app + +RUN wget http://repo1.maven.org/maven2/io/magentys/donut/${DONUT_VERSION}/donut-${DONUT_VERSION}-one-jar.jar /app/donut.jar + +ENTRYPOINT ["java", "-jar", "donut.jar", "-o", "/output"] diff --git a/README.md b/README.md index d30268f..690ebcd 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -![](http://magentys.github.io/donut/img/Donut-05.png) +![](http://magentys.github.io/donut/img/Donut-05.png) [![Build Status](https://travis-ci.org/MagenTys/donut.svg?branch=master)](https://travis-ci.org/MagenTys/donut) [![Maven Central](https://maven-badges.herokuapp.com/maven-central/io.magentys/donut/badge.svg)](https://maven-badges.herokuapp.com/maven-central/io.magentys/donut) @@ -10,7 +10,7 @@ Donut currently supports any tool that produces gherkin json (ie. cucumber-jvm e Live Demos => [Only Scenarios](http://magentys.github.io/donut/demo.html)   [Scenarios and Unit Tests](http://magentys.github.io/donut/demo-scenarios-and-unitTests.html)   [Scenarios and Orphaned Unit Tests](http://magentys.github.io/donut/demo-scenarios-and-orphanedUnitTests.html) ## Quickstart -You can either use Donut directly or check out the available plugins: +You can either use Donut directly or check out the available plugins: * [Maven plugin](https://github.com/MagenTys/donut-maven-plugin) * [Specflow adaptor](https://github.com/MagenTys/SpecNuts) * [Jenkins plugin](https://github.com/MagenTys/donut-jenkins-plugin) @@ -19,22 +19,41 @@ You can either use Donut directly or check out the available plugins: ## Release Notes See what's new [here](release-notes.md) -### download +### Download ``` wget http://repo1.maven.org/maven2/io/magentys/donut/1.0/donut-1.0-one-jar.jar ``` or download the latest release from: [here](http://repo1.maven.org/maven2/io/magentys/donut/1.0/donut-1.0-one-jar.jar) -### run from command line +### Run from command line ``` java -jar donut-.jar -s cucumber:/my/path/cucumber-reports -n myProjectName ``` -### options +### Run using Docker + +Donut is packaged as a [Docker container](https://hub.docker.com/r/donutreport/donut-report/) + +To run using Docker: +``` +docker run -v /path/to/your/cucumber-reports:/source -v /path/to/output-report:/output donutreport/donut-report -n myProjectName -s cucumber:/source [options] +``` + +In the above command, using the docker `-v` parameter `/source` and `/output` volumes are mounted in the container, to pass data in, and out. +Use `-s cucumber:/source` Donut option to retrieve the reports + +*Passing multiple source directories*: +If you need to pass multiple source directories, e.g. for Cucumber reports and unit tests, and the directories are in different paths, you can use the following variant: + +``` +docker run -v /path/to/your/cucumber-reports:/source -v /path/to/your/unit-test-reports:/source_unit -v /path/to/output-report:/output donutreport/donut-report -n myProjectName -s cucumber:/source,/source_unit [options] +``` + +### Options `-n` or `--projectName` is a mandatory parameter, and it should be the name of the project. -`-s` or `--sourcedirs` is a mandatory parameter, and it should be a comma separated list of the paths to the directories that hold the generated result files. +`-s` or `--sourcedirs` is a mandatory parameter, and it should be a comma separated list of the paths to the directories that hold the generated result files. Other parameters can also be specified as below: @@ -85,7 +104,7 @@ default values: ``` -* SBT +* SBT ``` libraryDependencies += "io.magentys" % "donut" % "1.0" ``` @@ -98,12 +117,12 @@ compile 'io.magentys:donut:1.0' Example usage of the `Generator` ``` -ReportConsole report = +ReportConsole report = Generator.apply(sourceDirectory, outputDirectory, filePrefix, timestamp, template, countSkippedAsFailure, countPendingAsFailure, countUndefinedAsFailure, countMissingAsFailure, projectName, projectVersion, customAttributes); ``` -This will create an `html` report at the outputDirectory and will return a `ReportConsole` output object: +This will create an `html` report at the outputDirectory and will return a `ReportConsole` output object: ``` allFeatures: List[Feature] @@ -126,17 +145,29 @@ buildFailed: Boolean ## Build from source -### prerequisites +### Prerequisites * install java 8+ * install scala 2.11+ * install SBT ([www.scala-sbt.org](http://www.scala-sbt.org)) -### run from sbt +### Run from sbt `sbt "run-main io.magentys.donut.Boot -s cucumber:/my/path/cucumber-reports -n myProjectName" ` -### credits +### Build Docker Container + +Set your Docker Hub credentials +``` +export VERSION=version_number +docker-compose run sbt +docker login +docker build . -t donutreport/donut-report +docker tag donutreport/donut-report donutreport/donut-report:$VERSION +docker push donutreport/donut-report:$VERSION +``` + +### Credits * JQuery * Bootstrap diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..25937f5 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,13 @@ +version: '2' +services: + sbt: + image: hseeberger/scala-sbt + entrypoint: + - sbt + - clean + - one-jar + working_dir: /work + volumes: + - .:/work + # Enable the use of Docker from within the container + - /var/run/docker.sock:/var/run/docker.sock diff --git a/project/build.properties b/project/build.properties index 58510cf..3e8bd1a 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version = 0.13.9 +sbt.version = 0.13.15