This repository has been archived by the owner on Oct 30, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature/#55 add build and push (#56)
* #55 Added build and push as goal #54 Added env vars * Added documentation for #54 and #55 * #55 No default value * #54 and #55 Tests added * #55 fixed test * Added version to check which version the travis is using * Travis docker-compose needs service when using build args * Cleanup for PR
- Loading branch information
Showing
49 changed files
with
598 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
FROM busybox | ||
|
||
CMD echo -e Docker Compose has build successfully |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
version: '3.2' | ||
services: | ||
test: | ||
image: mpdc-it-build-args | ||
container_name: mpdc-it-build-args | ||
build: ./ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<?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> | ||
|
||
<groupId>com.dkanejs.maven.plugins.it</groupId> | ||
<artifactId>build-args</artifactId> | ||
<version>1.0</version> | ||
|
||
<description>Verify "docker-compose build with arguments" runs.</description> | ||
|
||
<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> | ||
<id>build</id> | ||
<phase>verify</phase> | ||
<goals> | ||
<goal>build</goal> | ||
</goals> | ||
<configuration> | ||
<composeFile>${project.basedir}/docker-compose.yml</composeFile> | ||
<detachedMode>false</detachedMode> | ||
<services>test</services> | ||
<buildArgs> | ||
<args> | ||
<foo>bar</foo> | ||
<far>boor</far> | ||
</args> | ||
</buildArgs> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import java.nio.file.Paths | ||
|
||
String buildLog = new File("${basedir}/build.log").getText("UTF-8") | ||
String composeFile = Paths.get("${basedir}/docker-compose.yml").toString() | ||
|
||
assert buildLog.contains("Running: docker-compose -f $composeFile build --build-arg far=boor --build-arg foo=bar" as CharSequence) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
FROM busybox | ||
|
||
CMD echo -e Docker Compose has build successfully |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
version: '3.2' | ||
services: | ||
test: | ||
image: mpdc-it-build-forcerm | ||
container_name: mpdc-it-build-forcerm | ||
build: ./ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?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> | ||
|
||
<groupId>com.dkanejs.maven.plugins.it</groupId> | ||
<artifactId>build-force-rm</artifactId> | ||
<version>1.0</version> | ||
|
||
<description>Verify "docker-compose build with force rm" runs.</description> | ||
|
||
<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> | ||
<id>build</id> | ||
<phase>verify</phase> | ||
<goals> | ||
<goal>build</goal> | ||
</goals> | ||
<configuration> | ||
<composeFile>${project.basedir}/docker-compose.yml</composeFile> | ||
<detachedMode>false</detachedMode> | ||
<buildArgs> | ||
<forceRm>true</forceRm> | ||
</buildArgs> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import java.nio.file.Paths | ||
|
||
String buildLog = new File("${basedir}/build.log").getText("UTF-8") | ||
String composeFile = Paths.get("${basedir}/docker-compose.yml").toString() | ||
|
||
assert buildLog.contains("Running: docker-compose -f $composeFile build --force-rm" as CharSequence) | ||
assert buildLog.contains("Successfully tagged mpdc-it-build-forcerm") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
FROM busybox | ||
|
||
CMD echo -e Docker Compose has build successfully |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
version: '3.2' | ||
services: | ||
test: | ||
image: mpdc-it-build-nocache | ||
container_name: mpdc-it-build-nocache | ||
build: ./ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?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> | ||
|
||
<groupId>com.dkanejs.maven.plugins.it</groupId> | ||
<artifactId>build-no-cache</artifactId> | ||
<version>1.0</version> | ||
|
||
<description>Verify "docker-compose build with no cache" runs.</description> | ||
|
||
<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> | ||
<id>build</id> | ||
<phase>verify</phase> | ||
<goals> | ||
<goal>build</goal> | ||
</goals> | ||
<configuration> | ||
<composeFile>${project.basedir}/docker-compose.yml</composeFile> | ||
<detachedMode>false</detachedMode> | ||
<buildArgs> | ||
<noCache>true</noCache> | ||
</buildArgs> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import java.nio.file.Paths | ||
|
||
String buildLog = new File("${basedir}/build.log").getText("UTF-8") | ||
String composeFile = Paths.get("${basedir}/docker-compose.yml").toString() | ||
|
||
assert buildLog.contains("Running: docker-compose -f $composeFile build --no-cache" as CharSequence) | ||
assert buildLog.contains("Successfully tagged mpdc-it-build-nocache:latest") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
FROM busybox | ||
|
||
CMD echo -e Docker Compose has build successfully |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
version: '3.2' | ||
services: | ||
test: | ||
image: mpdc-it-build-pull | ||
container_name: mpdc-it-build-pull | ||
build: ./ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?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> | ||
|
||
<groupId>com.dkanejs.maven.plugins.it</groupId> | ||
<artifactId>build-pull</artifactId> | ||
<version>1.0</version> | ||
|
||
<description>Verify "docker-compose build with pull" runs.</description> | ||
|
||
<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> | ||
<id>build</id> | ||
<phase>verify</phase> | ||
<goals> | ||
<goal>build</goal> | ||
</goals> | ||
<configuration> | ||
<composeFile>${project.basedir}/docker-compose.yml</composeFile> | ||
<detachedMode>false</detachedMode> | ||
<buildArgs> | ||
<alwaysPull>true</alwaysPull> | ||
</buildArgs> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import java.nio.file.Paths | ||
|
||
String buildLog = new File("${basedir}/build.log").getText("UTF-8") | ||
String composeFile = Paths.get("${basedir}/docker-compose.yml").toString() | ||
|
||
assert buildLog.contains("Running: docker-compose -f $composeFile build --pull" as CharSequence) | ||
assert buildLog.contains("Successfully tagged mpdc-it-build-pull:latest") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
FROM busybox | ||
|
||
CMD echo -e Docker Compose has build successfully |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
version: '3.2' | ||
services: | ||
test: | ||
image: mpdc-it-build | ||
container_name: mpdc-it-build | ||
build: ./ |
Oops, something went wrong.