I have a mavenJob on a windows box that looks like this below.
I have the windows env vars I want to use on the system, as the script output shows me but...
I cant seem to use them where I need to ...
Any ideas ?
mavenJob(JobName.INTEGR_X_SANITY_TESTS_JOB.name) {
description sqmCtx.description('Sanity test suite for X GUI.')
customWorkspace('$JENKINS_HOME/workspace/x-ci-sanity') <<< here we can somehow “see” JENKINS_HOME as we expect to and …
//
with xCtx.slaveSetupMaven()
logRotator { daysToKeep(30) }
//
goals('clean test')
rootPOM('$JENKINS_HOME/workspace/x-ci-sanity/pom.xml')
mavenOpts('-Xmx2048m -Xms512m')
localRepository(LocalRepositoryLocation.LOCAL_TO_WORKSPACE)
environmentVariables { <<< … all the parms we need are visible in a script as *windows* variables as this echo works …
script('''
echo "JENKINS_HOME = [%JENKINS_HOME%]"
echo "CLUSTER = [%CLUSTER%]"
echo "X_JBOSS = [%X_JBOSS%]"
echo "X_ENGINE_SERVER = [%X_ENGINE_SERVER%]"
''')
}
parameters xCtx.njGuiParam('firefox', 'xCI-tests', “https://%X_JBOSS%/sqm”, “%X_ENGINE_SERVER%”); <<< … but we can’t seem to use them in the jobDSL parameters
To view this discussion on the web visit https://groups.google.com/d/msgid/job-dsl-plugin/9ed6584e-6463-4241-a883-f4883331f70a%40googlegroups.com.--
You received this message because you are subscribed to the Google Groups "job-dsl-plugin" group.
To unsubscribe from this group and stop receiving emails from it, send an email to job-dsl-plugin+unsubscribe@googlegroups.com.
To post to this group, send email to job-dsl-plugin@googlegroups.com.
@JobDslContext(BuildParametersContext)
Closure njGuiParam(String browser, String xml, String url='x', String dbServer='x') {
def (String newUrl, String newDbServer) = [url, dbServer]
if ( (dbServer != null) && (dbServer.contains('${X_ENGINE_SERVER}')) ) {
newDbServer = System.getenv("X_ENGINE_SERVER")
}
if ( (url != null) && (url.contains('${X_JBOSS}')) ) {
newUrl = 'https://' + System.getenv("X_JBOSS") + '/x'
}
return {
stringParam 'Browser', browser, 'parameter for browser driver';
stringParam 'suiteXmlFile', xml, 'test suite name';
stringParam 'URL', newUrl, 'GUI URL';
stringParam 'DB_SERVER', newDbServer, 'DB Server or X ENGINE Server for tests';
}
}
and invoked it with:
parameters sxCtx.njGuiParam('firefox', 'xCI-tests', 'https://' + '${X_JBOSS}' + '/x', '${X_ENGINE_SERVER}');