Skip to content

Commit 7c6e1c0

Browse files
committed
Move contribution guidelines into CONTRIBUTING page
Minor improvements to phrasing in the plugin documentation. Include instructions for developers that want to use the plugin, modeled after the HTTP client API 4 instructions.
1 parent 77147ad commit 7c6e1c0

File tree

2 files changed

+89
-26
lines changed

2 files changed

+89
-26
lines changed

CONTRIBUTING.md

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# Contributing to the plugin
2+
3+
Plugin source code is hosted on [GitHub](https://github.com/jenkinsci/docker-java-api-plugin).
4+
New feature proposals and bug fix proposals should be submitted as
5+
[GitHub pull requests](https://help.github.com/articles/creating-a-pull-request).
6+
Your pull request will be evaluated by the [Jenkins job](https://ci.jenkins.io/job/Plugins/job/docker-java-api-plugin/).
7+
8+
Before submitting your change, please assure that you've added tests which verify your change.
9+
10+
## Code formatting with spotless
11+
12+
Source code and pom file formatting are maintained by the `spotless` maven plugin.
13+
Before submitting a pull request, please format with:
14+
15+
* `mvn spotless:apply`
16+
17+
## Static analysis with spotbugs
18+
19+
Please don't introduce new spotbugs output.
20+
21+
* `mvn spotbugs:check` to analyze project using [Spotbugs](https://spotbugs.github.io)
22+
* `mvn spotbugs:gui` to review report using GUI
23+
24+
## Code Coverage
25+
26+
[JaCoCo code coverage](https://www.jacoco.org/jacoco/) reporting is available as a maven target and is [reported](https://ci.jenkins.io/job/Plugins/job/docker-java-api-plugin/) by the [Jenkins warnings plugin](https://plugins.jenkins.io/warnings-ng/).
27+
Please try to improve code coverage with tests when you submit a pull request.
28+
29+
* `mvn -P enable-jacoco clean install jacoco:report` to report code coverage with JaCoCo.
30+
31+
### Reviewing Code Coverage
32+
33+
The code coverage report is a set of HTML files that show methods and lines executed.
34+
The following commands will open the `index.html` file in the browser.
35+
36+
* Windows - `start target\site\jacoco\index.html`
37+
* Linux - `xdg-open target/site/jacoco/index.html`
38+
* Gitpod - `cd target/site/jacoco && python -m http.server 8000`
39+
40+
The file will have a list of package names.
41+
Click on them to find a list of class names.
42+
43+
The lines of the code will be covered in three different colors, red, green, and orange.
44+
Red lines are not covered in the tests.
45+
Green lines are covered with tests.
46+
47+
## Maintaining automated tests
48+
49+
Automated tests are run as part of the `verify` phase.
50+
Run automated tests in a development environment with the command:
51+
52+
```
53+
$ mvn clean verify
54+
```
55+
56+
## Report an Issue
57+
58+
Use the ["Report an issue" page](https://www.jenkins.io/participate/report-issue/redirect/#23136) to submit bug reports.
59+
Please review [existing issues](https://issues.jenkins.io/issues/?jql=resolution%20is%20EMPTY%20and%20component%3D23136) before submitting a new issue.
60+
Please use the ["How to Report an Issue"](https://www.jenkins.io/participate/report-issue/) guidelines when reporting issues.

README.md

Lines changed: 29 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,35 @@
11
# Docker Java API Plugin
22

3-
This plugin exposes the [docker-java](http://github.com/docker-java/docker-java) API to Jenkins plugins.
3+
This plugin provides the [docker-java](http://github.com/docker-java/docker-java) API to Jenkins plugins.
44
Plugins using docker-java should depend on this plugin and not directly on docker-java.
55

66
Only the Apache HttpClient 5 transport is available; the Jersey transport does not work.
77

8-
# Environment
9-
10-
The following build environment is required to build this plugin
11-
12-
* Java 11 and Maven 3.8.1
13-
14-
# Build
15-
16-
To build the plugin locally:
17-
18-
mvn clean verify
19-
20-
# Release
21-
22-
To release the plugin:
23-
24-
mvn release:prepare release:perform -B
25-
26-
# Test local instance
27-
28-
To test in a local Jenkins instance
29-
30-
mvn hpi:run
31-
32-
[wiki]: http://wiki.jenkins-ci.org/display/JENKINS/Docker+Java+API+Plugin
8+
## Using the API in your plugin
9+
10+
Replace the dependency to `com.github.docker-java:docker-java` with a dependency to `org.jenkins-ci.plugins:docker-java-api`.
11+
Avoid version conflicts by using the [Jenkins plugin BOM](https://github.com/jenkinsci/bom#readme) rather than depending on a specific version.
12+
13+
* Before:
14+
```
15+
<dependencies>
16+
...
17+
<dependency>
18+
<groupId>com.github.docker-java</groupId>
19+
<artifactId>docker-java</artifactId>
20+
<version>3.4.1</version>
21+
</dependency>
22+
...
23+
</dependencies>
24+
```
25+
* After:
26+
```
27+
<dependencies>
28+
...
29+
<dependency>
30+
<groupId>org.jenkins-ci.plugins</groupId>
31+
<artifactId>docker-java-api</artifactId>
32+
</dependency>
33+
...
34+
</dependencies>
35+
```

0 commit comments

Comments
 (0)