This repository has been archived by the owner on Sep 16, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#106 Getting started, added copyFileToString to simplify some things
- Loading branch information
Showing
11 changed files
with
123 additions
and
14 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# http://editorconfig.org | ||
root = true | ||
|
||
[*] | ||
indent_style = tab | ||
indent_size = 2 | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false | ||
|
||
[*.java] | ||
indent_size = 4 |
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
34 changes: 34 additions & 0 deletions
34
src/main/java/com/marklogic/appdeployer/command/forests/DeployCustomForestsCommand.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,34 @@ | ||
package com.marklogic.appdeployer.command.forests; | ||
|
||
import com.marklogic.appdeployer.command.AbstractCommand; | ||
import com.marklogic.appdeployer.command.CommandContext; | ||
import com.marklogic.appdeployer.command.SortOrderConstants; | ||
|
||
import java.io.File; | ||
|
||
/** | ||
* For each directory in the ml-config/forests directory, TODO. | ||
*/ | ||
public class DeployCustomForestsCommand extends AbstractCommand { | ||
|
||
public DeployCustomForestsCommand() { | ||
setExecuteSortOrder(SortOrderConstants.DEPLOY_FORESTS); | ||
} | ||
|
||
@Override | ||
public void execute(CommandContext context) { | ||
File dir = new File(context.getAppConfig().getConfigDir().getBaseDir(), "forests"); | ||
for (File f : dir.listFiles()) { | ||
if (f.isDirectory()) { | ||
processDirectory(f, context); | ||
} | ||
} | ||
} | ||
|
||
protected void processDirectory(File dir, CommandContext context) { | ||
for (File f : listFilesInDirectory(dir)) { | ||
logger.info("Processing: " + f.getAbsolutePath()); | ||
} | ||
|
||
} | ||
} |
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
27 changes: 27 additions & 0 deletions
27
src/test/java/com/marklogic/appdeployer/command/forests/DeployCustomForestsTest.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,27 @@ | ||
package com.marklogic.appdeployer.command.forests; | ||
|
||
import com.marklogic.appdeployer.AbstractAppDeployerTest; | ||
import com.marklogic.appdeployer.ConfigDir; | ||
import com.marklogic.appdeployer.command.databases.DeployContentDatabasesCommand; | ||
import org.junit.After; | ||
import org.junit.Test; | ||
|
||
import java.io.File; | ||
|
||
/** | ||
* Created by rrudin on 7/19/2016. | ||
*/ | ||
public class DeployCustomForestsTest extends AbstractAppDeployerTest { | ||
|
||
@After | ||
public void tearDown() { | ||
//undeploySampleApp(); | ||
} | ||
|
||
@Test | ||
public void test() { | ||
appConfig.setConfigDir(new ConfigDir(new File("src/test/resources/sample-app/custom-forests"))); | ||
initializeAppDeployer(new DeployContentDatabasesCommand(1), new DeployCustomForestsCommand()); | ||
deploySampleApp(); | ||
} | ||
} |
3 changes: 3 additions & 0 deletions
3
src/test/resources/sample-app/custom-forests/databases/content-database.json
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 @@ | ||
{ | ||
"database-name": "%%DATABASE%%" | ||
} |
14 changes: 14 additions & 0 deletions
14
src/test/resources/sample-app/custom-forests/forests/sample-app-content/custom-forests.json
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,14 @@ | ||
[ | ||
{ | ||
"forest-name": "sample-app-content-custom-1", | ||
"enabled": true, | ||
"host": "%%HOST%%", | ||
"database": "%%DATABASE%%" | ||
}, | ||
{ | ||
"forest-name": "sample-app-content-custom-2", | ||
"enabled": true, | ||
"host": "%%HOST%%", | ||
"database": "%%DATABASE%%" | ||
} | ||
] |