I'm new to Jenkins, please help me on this. I have a maven project which is bit complex so I have separated the tests using testNG xmls. Based on the execution flow I will selects the appropriate .xml file to build the project. For now what I'm doing is I'm building the script manually by selecting the required xml file as below.
I have set a choice parameter (name=testSuite) which includes all the xmls and include mvn clean test command in Build section.
mvn install test -DsuiteXmlFile=src/test/resources/testSuite/$testSuite
When I build it will get the selected value from the choice parameter drop down and execute.
But my requirement is I want to integrate this to run the build periodically in a specific time period. For that I tried using "Active Choice Parameters" but please help me how to call the selected check box options and proceed with mvn install test
Below is the approach I used.
- I created a pipeline script to generated "Active choice parameters and reference parameters"
- Then I tried to fetch the selected values using `echo "Scripts: ${params.Scripts}"
Below are my parameters,
- Active choice parameter: Flow
- Active choice reactive parameter :Scripts
- Active Reference parameter: Flow Information
the "Scripts" will include check boxes and the xml files
In this scenario how will I pass the selected xml to mvn clean test
because as of now it's passing all the selected values with comma separators ascaseCreation.xml,testng.xml
. Due to this how can I seperate each selected xmls and pass it to mvn install test -DsuiteXmlFile=src/test/resources/testSuite/$testSuite
.
And also please help me to figure out a better approach to have periodically builds in specific time period which could cater the above scenario.
Thanks in advance.
`
Below is an example of a declarative pipeline:
Scripted: