Skip to content

Extension points for pre build configuration

sben edited this page Apr 26, 2013 · 2 revisions

The extension points for the pre-build steps are defined in PretestCommitPreCheckout.java. To get a footprint in the configuration step, we inherit the BuildWrapper class. There is a corresponding jelly markup, PretestCommitPreCheckout/config.jelly, that defines the GUI elements. In addition to the defined layout, a single checkbox is automatically added to the "Build Environment" section of the configuration page for the job. When the box is checked, the interface defined by the jelly file is revealed.

The class has two functions that we can override to add pre-build functionality:

  • preCheckout(): This is called after the workspace has been set, but before any SCM function has been called.
  • setUp(): This is run after Jenkins has set the environment up and files have been checked out according to the SCM settings.

See the BuildWrapper Javadoc for details.

Clone this wiki locally