Skip to content

Dockerfile - #43

Open
temyers wants to merge 8 commits into
DonutReport:masterfrom
temyers:dockerfile
Open

Dockerfile#43
temyers wants to merge 8 commits into
DonutReport:masterfrom
temyers:dockerfile

Conversation

@temyers

@temyers temyers commented Sep 28, 2017

Copy link
Copy Markdown
  • Add a Dockerfile for use as a container
  • Add docker-compose.yml to for containerised build (also updated the build.properties to match the sbt version in the container)
  • Updated README.md with instructions for using the container.

Container published here:
https://hub.docker.com/u/donutreport/dashboard/

Tim Myerscough added 3 commits September 28, 2017 17:34
cache dependencies for travis build

Build container from published version.  Will use autobuild on Docker Hub

Add instructions for manual Docker deployment
Comment thread Dockerfile Outdated

WORKDIR /app

RUN wget http://repo1.maven.org/maven2/io/magentys/donut/1.0/donut-1.0-one-jar.jar /app/donut.jar

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding docker to the Travis build, caused test failures due to ordering conflict when reading files.

Therefore building and deploying to DockerHub at the moment would be manual and should use released versions.

Alternatively, we could build the one-jar prior to building the container and copy it in (details are in the README for that)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line could change to

COPY target/donut*-one-jar.jar /app/donut.jar

Comment thread README.md Outdated

To run using Docker:
```
docker run -v /path/to/your/cucumber-reports:/source -v /path/to/output-report:/output donutreport/donut-docker -n myProjectName [options]

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The input and output volumes are required to ensure the folders are available to the container, and aren't lost when the report is generated.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The name of image is incorrect. It should be donutreport/donut-report .

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll fix this.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This command fails with a donut exception when we pass multiple paths ex: docker run -v /Users/amit/git-repositories/donut/src/test/resources/cuke-and-unit/cuke,/Users/amit/git-repositories/donut/src/test/resources/cuke-and-unit/unit:/source -v /Users/amit/tempd/report:/output donutreport/donut-report -n myProject
0 [main] INFO io.magentys.donut.gherkin.Generator$ - source paths: cucumber:/source
11 [main] INFO io.magentys.donut.gherkin.Generator$ - Cuke path: /source
Exception in thread "main" java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:564)
at com.simontuffs.onejar.Boot.run(Boot.java:340)
at com.simontuffs.onejar.Boot.main(Boot.java:166)
Caused by: io.magentys.donut.gherkin.DonutException
at io.magentys.donut.gherkin.Generator$.apply(Generator.scala:39)
at io.magentys.donut.Boot$.delayedEndpoint$io$magentys$donut$Boot$1(Boot.scala:85)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It works for one path(the cucumber path). But it should be able to accept the both cucumber and unit test json paths ex: cucumber:/my/cucumber/path,/my/JUnit/path

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've updated so you need to specify the -s command yourself.
Updated the README

@temyers
temyers requested a review from marcelloromani October 2, 2017 02:00
Comment thread README.md Outdated

To run using Docker:
```
docker run -v /path/to/your/cucumber-reports:/source -v /path/to/output-report:/output donutreport/donut-docker -n myProjectName [options]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The name of image is incorrect. It should be donutreport/donut-report .

Comment thread README.md Outdated

To run using Docker:
```
docker run -v /path/to/your/cucumber-reports:/source -v /path/to/output-report:/output donutreport/donut-docker -n myProjectName [options]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll fix this.

Comment thread README.md Outdated

To run using Docker:
```
docker run -v /path/to/your/cucumber-reports:/source -v /path/to/output-report:/output donutreport/donut-docker -n myProjectName [options]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This command fails with a donut exception when we pass multiple paths ex: docker run -v /Users/amit/git-repositories/donut/src/test/resources/cuke-and-unit/cuke,/Users/amit/git-repositories/donut/src/test/resources/cuke-and-unit/unit:/source -v /Users/amit/tempd/report:/output donutreport/donut-report -n myProject
0 [main] INFO io.magentys.donut.gherkin.Generator$ - source paths: cucumber:/source
11 [main] INFO io.magentys.donut.gherkin.Generator$ - Cuke path: /source
Exception in thread "main" java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:564)
at com.simontuffs.onejar.Boot.run(Boot.java:340)
at com.simontuffs.onejar.Boot.main(Boot.java:166)
Caused by: io.magentys.donut.gherkin.DonutException
at io.magentys.donut.gherkin.Generator$.apply(Generator.scala:39)
at io.magentys.donut.Boot$.delayedEndpoint$io$magentys$donut$Boot$1(Boot.scala:85)

Comment thread README.md Outdated

To run using Docker:
```
docker run -v /path/to/your/cucumber-reports:/source -v /path/to/output-report:/output donutreport/donut-docker -n myProjectName [options]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It works for one path(the cucumber path). But it should be able to accept the both cucumber and unit test json paths ex: cucumber:/my/cucumber/path,/my/JUnit/path

Comment thread README.md

Donut is packaged as a [Docker container](https://hub.docker.com/r/donutreport/donut-report/)

To run using Docker:

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You added a clarifying statement here regarding the version. By default, the current command will choose the LATEST image available.

I've extracted the version into an ENV. This will need to be updated as part of the release, etc.
I've updated the instructions for tagging/deploy to specify the version number.
The version of the container, should match the version of Donut Maven project..

Comment thread README.md

Set your Docker Hub credentials
```
export VERSION=version_number

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are manual commands at the moment, and need to tally the version.

Next steps will be to automatically build, and will need to get the version from SBT

Comment thread README.md

```
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]
```

@amitsha256 amitsha256 Oct 6, 2017

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These commands are not working. I got this:
Error: Unknown option -s Error: Unknown argument 'cucumber:/source'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants