Skipping steps in Jenkins job

12,539

Try the Conditional BuildStep Plugin, which requires the Run Condition Plugin With these two plugins, you can conditionalize any build step and skip anyone that you like.

Share:
12,539
Daniel Mai
Author by

Daniel Mai

Updated on July 20, 2022

Comments

  • Daniel Mai
    Daniel Mai almost 2 years

    When you have a long running job in Jenkins which is composed of many steps, and you are actively developing / debugging this job you need to be able to disable some of the steps to skip to a certain step which is been debugged.

    How do you do that ?

    Obviously you can try to delete the steps not interested in, but that is a pain because restoring these steps is error prone. Same goes for editing them to make them skip by giving them some parameter like -DskipTests.

    Another alternative would be to copy the job, but then it's a pain again, because checkout for our relevantly large project takes ages. We can manually copy workspace but that is hard work as well.

    What better solutions are there to this problem ?

  • Tim Büthe
    Tim Büthe over 10 years
    That seems like a possibility, but also an overkill. I just want a disabled checkbox next to the step. Is there no plugin for this?
  • Jason Swager
    Jason Swager over 10 years
    No. The change you're thinking of would probably require a baseline Jenkins change to the base build step classes and similar change to all the UI files. Changing those files might be a per-plugin change. Would be nice, but not currently available.
  • sschuberth
    sschuberth about 10 years
    It's not such much overkill after all, instead of a checkbox you just have to switch between "Always" or "Never" from the "Run?" combobox. The only drawback is that you cannot simply wrap existing build steps with the condition but have to re-create the build steps within the condition.