Configure Jenkins to poll an environment by a script.
You can provide a script content or a script file path.
Script execution exit code is checked.
If the script execution returns the expected code, a build is triggered.
You are able to configure the exit code. By default, the exit code is evaluated to '0'.

Note: You are able to inject environment variables in the script by using the envinject Jenkins plugin.