This repository has been archived by the owner on Jun 22, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0ade498
commit 2a6874a
Showing
10 changed files
with
115 additions
and
8 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
9 changes: 9 additions & 0 deletions
9
minimesos/src/main/groovy/com/containersol/minimesos/config/ContainerConfig.groovy
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 |
---|---|---|
@@ -1,14 +1,23 @@ | ||
package com.containersol.minimesos.config | ||
|
||
|
||
/** | ||
* Common methods for containers' configuration | ||
*/ | ||
interface ContainerConfig { | ||
|
||
public static final String DEFAULT_NETWORK_MODE = "bridge" | ||
|
||
String getImageName() | ||
|
||
void setImageName(String imageName) | ||
|
||
String getImageTag() | ||
|
||
void setImageTag(String imageTag) | ||
|
||
String getNetworkMode() | ||
|
||
void setNetworkMode(String networkMode) | ||
|
||
} |
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
2 changes: 2 additions & 0 deletions
2
minimesos/src/main/groovy/com/containersol/minimesos/config/MesosContainerConfig.groovy
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
16 changes: 16 additions & 0 deletions
16
minimesos/src/main/groovy/com/containersol/minimesos/config/ZookeeperConfig.groovy
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 |
---|---|---|
@@ -1,11 +1,27 @@ | ||
package com.containersol.minimesos.config | ||
|
||
import org.apache.commons.lang.StringUtils | ||
|
||
public class ZooKeeperConfig extends GroovyBlock implements ContainerConfig { | ||
|
||
public static final String MESOS_LOCAL_IMAGE = "jplock/zookeeper" | ||
public static final String ZOOKEEPER_IMAGE_TAG = "3.4.6" | ||
|
||
String imageName = MESOS_LOCAL_IMAGE | ||
String imageTag = ZOOKEEPER_IMAGE_TAG | ||
String networkMode = DEFAULT_NETWORK_MODE | ||
|
||
@Override | ||
String getNetworkMode() { | ||
return networkMode | ||
} | ||
|
||
@Override | ||
void setNetworkMode(String networkMode) { | ||
if (!StringUtils.equalsIgnoreCase(networkMode, "bridge") && !StringUtils.equalsIgnoreCase(networkMode, "host")) { | ||
throw new RuntimeException("Property 'networkMode' can only have the values 'bridge' or 'host'") | ||
} | ||
this.networkMode = networkMode | ||
} | ||
|
||
} |
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