We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I am performing a variation on the following test code:
@Unroll void 'test DSL script #file.name can generate Job XML'(File file) { given: JobManagement jm = new JenkinsJobManagement( System.out, [SCM_ROOT: '//depot/branches/external_dsl/test', BRANCH_NAME: 'external_dsl', AUTOMATION_ENVIRONMENT: dslConfig.path], workspaceRoot) when: GeneratedItems items = new DslScriptLoader(jm).runScript(file.text) then: noExceptionThrown() assertJobsBuilt(writeOutXmlForGeneratedJobs(items) ) where: file << jobFiles }
In the actual seed Job, I have an additional groovy file, generateBranchConfigs.groovy, which runs prior to the DSL processing.
I have tried to include the following in my setupSpec() method:
GroovyShell sh = new GroovyShell() String[] shellArgs = [] File groovyFile = new File("/dsl/src/main/resources/scripts/generateBranchConfigs.groovy") sh.run(groovyFile, shellArgs as String[])
However, this approach doesn't have the environment variables that I inject.
Should I set the local environment variables in setupSpec(), or is there a way to configure jm to include the file-generation groovy script?
setupSpec()
jm
PS - the code above results in an error, because the Groovy script retrieves null for a required Environment Variable.
null
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I am performing a variation on the following test code:
In the actual seed Job, I have an additional groovy file, generateBranchConfigs.groovy, which runs prior to the DSL processing.
I have tried to include the following in my setupSpec() method:
However, this approach doesn't have the environment variables that I inject.
Should I set the local environment variables in
setupSpec()
, or is there a way to configurejm
to include the file-generation groovy script?PS - the code above results in an error, because the Groovy script retrieves
null
for a required Environment Variable.The text was updated successfully, but these errors were encountered: