Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing hard-coding of admin/admin in project setup #811

Merged
merged 2 commits into from
Mar 21, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 45 additions & 34 deletions marklogic-data-hub/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,22 @@ dependencies {
testCompile 'org.hamcrest:hamcrest-junit:2.0.0.0'
testCompile 'org.easymock:easymock:3.4'
testCompile 'ch.qos.logback:logback-classic:1.1.11'
testCompile 'org.slf4j:log4j-over-slf4j:1.7.13'
testCompile("com.marklogic:mlcp-util:0.3.0")
testCompile("com.marklogic:mlcp:9.0.3") {
exclude group: 'org.apache.avro', module: 'avro-tools'
}
}


configurations.all {
exclude group: "org.slf4j", module: "slf4j-log4j12"
exclude group: "log4j", module: "log4j"
}




import com.marklogic.mgmt.ManageClient
import com.marklogic.mgmt.resource.hosts.HostManager

Expand Down Expand Up @@ -249,42 +260,42 @@ task collectorTest(type: Test, dependsOn: testClasses) {
maxHeapSize = "256m"
}

task createLocalFile{
boolean sslRun = Boolean.parseBoolean(System.properties['ssl'])
boolean certAuth = Boolean.parseBoolean(System.properties['certauth'])
com.marklogic.mgmt.ManageClient mC = new ManageClient(new com.marklogic.mgmt.ManageConfig());
com.marklogic.mgmt.resource.hosts.HostManager hm = new HostManager(mC);
def bootStrapHost = hm.getHostNames().get(0);
def fileName = "gradle-local.properties"
def inputFile = new File(fileName)
if(sslRun) {
inputFile.write("# Put your overrides from gradle.properties here\n" +
"# Don't check this in to version control\n" +
"mlJobSimpleSsl=true\n" +
"mlTraceSimpleSsl=true\n" +
"mlFinalSimpleSsl=true\n" +
"mlAdminScheme=https\n" +
"mlManageScheme=https\n" +
"mlStagingSimpleSsl=true")
}
if(certAuth) {
inputFile.write("# Put your overrides from gradle.properties here\n" +
"# Don't check this in to version control\n" +
"mlStagingAuth=certificate\n" +
"mlTraceAuth=certificate\n" +
"mlFinalAuth=certificate\n" +
"mlHost="+bootStrapHost+"\n"+
"mlAdminScheme=https\n" +
"mlManageScheme=https\n" +
"mlJobAuth=certificate")
}
}
//task createLocalFile() {
// boolean sslRun = Boolean.parseBoolean(System.properties['ssl'])
// boolean certAuth = Boolean.parseBoolean(System.properties['certauth'])
// com.marklogic.mgmt.ManageClient mC = new ManageClient(new com.marklogic.mgmt.ManageConfig());
// com.marklogic.mgmt.resource.hosts.HostManager hm = new HostManager(mC);
// def bootStrapHost = hm.getHostNames().get(0);
// def fileName = "gradle-local.properties"
// def inputFile = new File(fileName)
// if(sslRun) {
// inputFile.write("# Put your overrides from gradle.properties here\n" +
// "# Don't check this in to version control\n" +
// "mlJobSimpleSsl=true\n" +
// "mlTraceSimpleSsl=true\n" +
// "mlFinalSimpleSsl=true\n" +
// "mlAdminScheme=https\n" +
// "mlManageScheme=https\n" +
// "mlStagingSimpleSsl=true")
// }
//
// if(certAuth) {
// inputFile.write("# Put your overrides from gradle.properties here\n" +
// "# Don't check this in to version control\n" +
// "mlStagingAuth=certificate\n" +
// "mlTraceAuth=certificate\n" +
// "mlFinalAuth=certificate\n" +
// "mlHost="+bootStrapHost+"\n"+
// "mlAdminScheme=https\n" +
// "mlManageScheme=https\n" +
// "mlJobAuth=certificate")
// }
//}

test {
// we exclude the StreamCollectorTest
exclude '**/StreamCollector*'
dependsOn tasks.createLocalFile
//dependsOn tasks.createLocalFile
// depend on the collectorTest task above
dependsOn tasks.collectorTest
}
dependsOn tasks.collectorTest
}
23 changes: 11 additions & 12 deletions marklogic-data-hub/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
#

mlConfigDir=marklogic-data-hub/src/main/resources/ml-config

mlHost=localhost
Expand All @@ -23,34 +20,36 @@ mlAppName=data-hub
mlUsername=admin
mlPassword=admin

mlAdminUsername=admin
mlAdminPassword=admin

mlStagingAppserverName=data-hub-STAGING
mlStagingPort=8010
mlStagingDbName=data-hub-STAGING
mlStagingForestsPerHost=4
mlStagingForestsPerHost=1

mlFinalAppserverName=data-hub-FINAL
mlFinalPort=8011
mlFinalDbName=data-hub-FINAL
mlFinalForestsPerHost=4
mlFinalForestsPerHost=1

mlTraceAppserverName=data-hub-TRACING
mlTracePort=8012
mlTraceDbName=data-hub-TRACING
mlTraceForestsPerHost=1

mlJobAppserverName=data-hub-JOB
mlJobAppserverName=data-hub-JOBS
mlJobPort=8013
mlJobDbName=data-hub-JOB
mlJobDbName=data-hub-JOBS
mlJobForestsPerHost=1

mlModulesDbName=data-hub-MODULES
mlTriggersDbName=data-hub-TRIGGERS
mlSchemasDbName=data-hub-SCHEMAS

hubProjectDir=examples/hr-hub

mlReplaceTokensInModules=true
mlUseRoxyTokenPrefix=false


## These values are used by the testing infrastructure.
mlHubUserRole=data-hub-role
mlHubUserName=data-hub-user
# this password is used for the unit and integration tests.
mlHubUserPassword=eO3^)&X|j_O8m^k_2=xi
Loading