-
Notifications
You must be signed in to change notification settings - Fork 642
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
introduced cmd and entrypoint with exec and shell form support. the change is not backward compatible to the previous version. Signed-off-by: Oleg Sigida <oleg.sigida@gmail.com>
- Loading branch information
Showing
14 changed files
with
257 additions
and
83 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
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
71 changes: 71 additions & 0 deletions
71
src/main/java/org/jolokia/docker/maven/config/Arguments.java
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,71 @@ | ||
package org.jolokia.docker.maven.config; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
public class Arguments { | ||
|
||
/** | ||
* @parameter | ||
*/ | ||
private String shell; | ||
|
||
/** | ||
* @parameter | ||
*/ | ||
private List<String> params; | ||
|
||
public void setShell(String shell) { | ||
this.shell = shell; | ||
} | ||
|
||
public String getShell() { | ||
return shell; | ||
} | ||
|
||
public void setParams(List<String> params) { | ||
this.params = params; | ||
} | ||
|
||
public List<String> getParams() { | ||
return params; | ||
} | ||
|
||
public void validate() throws IllegalArgumentException { | ||
if (shell == null && (params == null || params.isEmpty())){ | ||
throw new IllegalArgumentException("Argument conflict, either shell or params should be specified"); | ||
} | ||
if (shell != null && params != null) { | ||
throw new IllegalArgumentException("Argument conflict, either shell or params should be specified"); | ||
} | ||
} | ||
|
||
public static class Builder { | ||
private String shell; | ||
private List<String> params; | ||
|
||
public static Builder get(){ | ||
return new Builder(); | ||
} | ||
|
||
public Builder withShell(String shell){ | ||
this.shell = shell; | ||
return this; | ||
} | ||
|
||
public Builder withParam(String param){ | ||
if (params == null) { | ||
params = new ArrayList<>(); | ||
} | ||
this.params.add(param); | ||
return this; | ||
} | ||
|
||
public Arguments build(){ | ||
Arguments a = new Arguments(); | ||
a.setShell(shell); | ||
a.setParams(params); | ||
return a; | ||
} | ||
} | ||
} |
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
Oops, something went wrong.