Complicated Build Options

You are viewing an old version (v. 2) of this page.
The latest version is v. 8, last edited on Jun 23, 2011 (view differences | )
<< View previous version | view page history | view next version >>

Situation

Set up the configuration so that it can ask user for below settings when manually triggered:

  1. User can select either Smoke Test Mode or Acceptance Test Mode.
  2. When Smoke Test Mode is selected, user can continue to select Component A and/or Component B to test.
  3. When Acceptance Test Mode is selected, user can continue to select Component C and/or Component D to test.
  4. User can select which nodes to run the test.

    Demonstration

  5. Open this configuration and hit the run button.
  6. A build option screen will be presented with desired settings. Make some selection and hit the OK button.
  7. Wait for some time for the build to finish. Check the step status screen, and you will find that the test step has been executed on the nodes you specified in the build option screen.
  8. Open build log and check output of the test step. The selected test mode and components are printed in the log correctly.

    Resolution

  9. Create a custom plugin implementing the PromptBeanProvider extension point to provider your own build option bean. You may start with the sample plugin com.example.promptbean in directory <QuickBuild server install dir>/dev/plugin/samples, and modify various build option setting classes as necessary. Refer to Bean Editor on how to annotate your beans for editing purpose. This tutorial uses the sample plugin directly.
  10. Stop QuickBuild, deploy your plugin to QuickBuild, and then start QuickBuild. Refer to Plugin Tutorials on how to do this.
  11. Define a variable with prompt setting set to prompt for bean input, and choose the bean you provided in your plugin. In this tutorial, we choosed the Example Prompt Bean as demonstrated here.
  12. Please note that we also specified default value of the bean by creating the bean object with groovy, assigning default values to its fields, and convert it to a string.
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.