Skip to content
This repository has been archived by the owner on Oct 30, 2020. It is now read-only.

Commit

Permalink
Cleanup project (#68)
Browse files Browse the repository at this point in the history
update version to snapshot
update editorconfig ruleset
add security reporting information in SECURITY.md
add editor maven plugin maven lifecycle
remove IDE specific files from gitignore
remove version specifics from readme
remove Gitter link from readme
remove extra trailing newlines project wide
remove purging of images at the end of each test
run formatter on all files
  • Loading branch information
David Kane authored Aug 24, 2019
1 parent 87acdaf commit 83ea97c
Show file tree
Hide file tree
Showing 38 changed files with 538 additions and 611 deletions.
12 changes: 5 additions & 7 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
root = true

[*]
charset = utf-8
end_of_line = lf
indent_size = 4
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true
charset = utf-8
tab_width = 4

[*.java]
indent_style = tab
indent_size = 4

[**.yml]
indent_style = space
[{*.yaml,*.yml}]
indent_size = 2
4 changes: 1 addition & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
.idea
*.iml
target
target
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# Docker Compose Maven Plugin
[![Build Status](https://travis-ci.org/dkanejs/docker-compose-maven-plugin.svg?branch=master)](https://travis-ci.org/dkanejs/docker-compose-maven-plugin)
[![Join the chat at https://gitter.im/dkanejs/docker-compose-maven-plugin](https://badges.gitter.im/dkanejs/docker-compose-maven-plugin.svg)](https://gitter.im/dkanejs/docker-compose-maven-plugin?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.dkanejs.maven.plugins/docker-compose-maven-plugin/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.dkanejs.maven.plugins/docker-compose-maven-plugin)

## Quickstart
Available on Maven Central.

```xml
<dependency>
<groupId>com.dkanejs.maven.plugins</groupId>
<artifactId>docker-compose-maven-plugin</artifactId>
<version>2.4.0</version>
<version>$VERSION</version>
</dependency>
```

Expand Down Expand Up @@ -54,7 +54,7 @@ This can be configured in the configuration section of the plugin:
```

#### envFile
`envFile` - Location of a file containing environment variables for docker-compose in key=value format, one pair per line.
`envFile` - Location of a file containing environment variables for docker-compose in key=value format, one pair per line.

This can be configured in the configuration section of the plugin:
```xml
Expand Down Expand Up @@ -239,8 +239,8 @@ This can be changed in the configuration section of the plugin:
</configuration>
```

Additional option `removeImagesType` allows to specify `type` parameter of `--rmi` docker compose flag.
`all` is the default value.
Additional option `removeImagesType` allows to specify `type` parameter of `--rmi` docker compose flag.
`all` is the default value.
`local` is the second supported type.

```xml
Expand All @@ -259,7 +259,7 @@ Below will allow use of the plugin from the `mvn` command line:
<plugin>
<groupId>com.dkanejs.maven.plugins</groupId>
<artifactId>docker-compose-maven-plugin</artifactId>
<version>2.4.0</version>
<version>$VERSION</version>
</plugin>
</plugins>
</build>
Expand All @@ -274,7 +274,7 @@ Below has customised the location of the `docker-compose.yml` file and has two e
<plugin>
<groupId>com.dkanejs.maven.plugins</groupId>
<artifactId>docker-compose-maven-plugin</artifactId>
<version>2.4.0</version>
<version>$VERSION</version>
<executions>
<execution>
<id>up</id>
Expand Down
3 changes: 3 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Reporting Security Issues

To report a security issue, email [dkanejs@gmail.com](mailto:dkanejs@gmail.com) and include the word "SECURITY" in the subject line.
16 changes: 15 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<groupId>com.dkanejs.maven.plugins</groupId>
<artifactId>docker-compose-maven-plugin</artifactId>
<version>2.4.0</version>
<version>2.4.1-SNAPSHOT</version>

<packaging>maven-plugin</packaging>

Expand Down Expand Up @@ -62,6 +62,20 @@

<build>
<plugins>
<plugin>
<groupId>org.ec4j.maven</groupId>
<artifactId>editorconfig-maven-plugin</artifactId>
<version>0.0.10</version>
<executions>
<execution>
<id>check</id>
<phase>verify</phase>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-plugin-plugin</artifactId>
Expand Down
4 changes: 0 additions & 4 deletions src/it/down-remove-images-local/verify.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,3 @@ String composeFile = Paths.get("${basedir}/docker-compose.yml").toString()
assert buildLog.contains("Running: docker-compose -f $composeFile up -d --no-color" as CharSequence)
assert buildLog.contains("Running: docker-compose -f $composeFile down --rmi local" as CharSequence)
assert buildLog.contains("Removing images")

def cleanUpProcess = new ProcessBuilder("docker", "system", "prune", "-a", "-f").start().waitFor()

assert cleanUpProcess == 0
4 changes: 0 additions & 4 deletions src/it/down-remove-images/verify.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,3 @@ String composeFile = Paths.get("${basedir}/docker-compose.yml").toString()
assert buildLog.contains("Running: docker-compose -f $composeFile up -d --no-color" as CharSequence)
assert buildLog.contains("Running: docker-compose -f $composeFile down --rmi all" as CharSequence)
assert buildLog.contains("Removing images")

def cleanUpProcess = new ProcessBuilder("docker", "system", "prune", "-a", "-f").start().waitFor()

assert cleanUpProcess == 0
4 changes: 0 additions & 4 deletions src/it/down-remove-orphans/verify.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,3 @@ String composeFile = Paths.get("${basedir}/docker-compose.yml").toString()
assert buildLog.contains("Running: docker-compose -f $composeFile up -d --no-color" as CharSequence)
assert buildLog.contains("Running: docker-compose -f $composeFile down --remove-orphans" as CharSequence)
assert buildLog.contains("Removing orphans")

def cleanUpProcess = new ProcessBuilder("docker", "system", "prune", "-a", "-f").start().waitFor()

assert cleanUpProcess == 0
2 changes: 1 addition & 1 deletion src/it/down-remove-volumes/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ services:
image: busybox
container_name: mpdc-it-down-remove-volumes
volumes:
- test-volume:/opt/test
- test-volume:/opt/test
command: sleep 600

volumes:
Expand Down
4 changes: 0 additions & 4 deletions src/it/down-remove-volumes/verify.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,3 @@ String composeFile = Paths.get("${basedir}/docker-compose.yml").toString()
assert buildLog.contains("Running: docker-compose -f $composeFile up -d --no-color" as CharSequence)
assert buildLog.contains("Running: docker-compose -f $composeFile down -v" as CharSequence)
assert buildLog.contains("Removing volume")

def cleanUpProcess = new ProcessBuilder("docker", "system", "prune", "-a", "-f").start().waitFor()

assert cleanUpProcess == 0
6 changes: 0 additions & 6 deletions src/it/down/verify.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,3 @@ String composeFile = Paths.get("${basedir}/docker-compose.yml").toString()

assert buildLog.contains("Running: docker-compose -f $composeFile up -d --no-color" as CharSequence)
assert buildLog.contains("Running: docker-compose -f $composeFile down" as CharSequence)

def cleanUpProcess = new ProcessBuilder("docker", "system", "prune", "-a", "-f").start().waitFor()

assert cleanUpProcess == 0


64 changes: 32 additions & 32 deletions src/it/settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,36 +20,36 @@ under the License.
-->

<settings>
<profiles>
<profile>
<id>it-repo</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<repositories>
<repository>
<id>local.central</id>
<url>@localRepositoryUrl@</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>local.central</id>
<url>@localRepositoryUrl@</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
<profiles>
<profile>
<id>it-repo</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<repositories>
<repository>
<id>local.central</id>
<url>@localRepositoryUrl@</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>local.central</id>
<url>@localRepositoryUrl@</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
</settings>
52 changes: 26 additions & 26 deletions src/it/up-api-version/pom.xml
Original file line number Diff line number Diff line change
@@ -1,40 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>com.dkanejs.maven.plugins.it</groupId>
<groupId>com.dkanejs.maven.plugins.it</groupId>
<artifactId>up-api-version</artifactId>
<version>1.0</version>

<description>Verify "docker-compose up with api version" runs.</description>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<build>
<plugins>
<plugin>
<groupId>@project.groupId@</groupId>
<artifactId>@project.artifactId@</artifactId>
<version>@project.version@</version>
<executions>
<execution>
<build>
<plugins>
<plugin>
<groupId>@project.groupId@</groupId>
<artifactId>@project.artifactId@</artifactId>
<version>@project.version@</version>
<executions>
<execution>
<id>up</id>
<phase>verify</phase>
<goals>
<goal>up</goal>
</goals>
<configuration>
<goals>
<goal>up</goal>
</goals>
<configuration>
<composeFile>${project.basedir}/docker-compose.yml</composeFile>
<detachedMode>false</detachedMode>
<verbose>true</verbose>
<apiVersion>1.22</apiVersion>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<verbose>true</verbose>
<apiVersion>1.22</apiVersion>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
4 changes: 0 additions & 4 deletions src/it/up-api-version/verify.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,3 @@ String composeFile = Paths.get("${basedir}/docker-compose.yml").toString()
assert buildLog.contains("Running: docker-compose -f $composeFile --verbose up --no-color" as CharSequence)
assert buildLog.contains("COMPOSE_API_VERSION: 1.22")
assert buildLog.contains("Docker Compose has run successfully")

def cleanUpProcess = new ProcessBuilder("docker", "system", "prune", "-a", "-f").start().waitFor()

assert cleanUpProcess == 0
Loading

0 comments on commit 83ea97c

Please sign in to comment.