1 | initial version |
Jenkins has a built-in timeout feature that can be used to mark a build as failed if it takes too long to complete. Here are the steps to set a timeout and mark the build as failed once the timeout is reached:
timeout 60 || exit 1
This will cause the build to fail if it takes more than 60 seconds to complete.
Now, if the build takes longer than 60 seconds, it will be marked as failed and the status will change to "FAILED".