Jenkins_input and Jenkins_timeout

Jenkins_timeout_input step

Jenkinsfile which consists of stages, whereas stages consists of multiple steps to perform the task, A single pipeline will have multiple stages and steps.

When we use pipeline to build, the pipeline will execute continuously until pipeline code ends.

If i have a pipeline which uses to deploy webserver to various environments such as Development, test and QA. I will add this stages and steps to deploy webserver into this environments. Now my pipeline will start and end up with deploying webserver in all environments.

Instead of automatically deploying to all environments, i can choose an option with manual intervention for deploying in stages. Which is called input step.

Input : Input step defines the pipeline to be wait for input message to proceed further action or to abort the pipeline. Here input is used along with message term which uses to show the message or description.

Hence the following input step will displays as:

Input step in Jenkinsfile
Output View of Input step in Jenkins blue ocean

In the above input message will be displayed with Proceed and Abort option. Based on providing manual input, pipeline will take an action.

timeout: timeout option will help to execute or run the build until provided time, after that aborts the build automatically.

Here timeout can be use along with input message step, hence it performs to wait for input message until provided time. If user not provides the input in the mean time, after reaching to time limit which is mentioned in timeout step, build will automatically aborts.

timeout consists of time and units as factors, where units can be SECONDS, MINUTES and HOURS, and time can be given as required.

timeout and input steps.

In the above pipeline, timeout and input are given in steps with time limit of 30 seconds. When pipelines executes this steps, message will be displayed until 30 seconds for input. After reaching of 30 seconds, Build aborts automatically.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store