Package jenkins.util.groovy
Class GroovyHookScript
java.lang.Object
jenkins.util.groovy.GroovyHookScript
A collection of Groovy scripts that are executed as various hooks.
For a given hook name, like "init", the following locations are searched for hook scripts, and then they are executed in turn.
- /WEB-INF/HOOK.groovy in the war file
- /WEB-INF/HOOK.groovy.d/*.groovy in the war file
- $JENKINS_HOME/HOOK.groovy
- $JENKINS_HOME/HOOK.groovy.d/*.groovy
Scripts inside /WEB-INF
is meant for OEM distributions of Jenkins. Files inside
$JENKINS_HOME
are for installation local settings. Use of HOOK.groovy.d
allows configuration management tools to control scripts easily.
- Author:
- Kohsuke Kawaguchi
-
Constructor Summary
ConstructorDescriptionGroovyHookScript
(String hook) Deprecated.GroovyHookScript
(String hook, jakarta.servlet.ServletContext servletContext, File jenkinsHome, ClassLoader loader) GroovyHookScript
(String hook, javax.servlet.ServletContext servletContext, File jenkinsHome, ClassLoader loader) Deprecated. -
Method Summary
-
Constructor Details
-
GroovyHookScript
Deprecated. -
GroovyHookScript
public GroovyHookScript(String hook, @NonNull jakarta.servlet.ServletContext servletContext, @NonNull File jenkinsHome, @NonNull ClassLoader loader) -
GroovyHookScript
@Deprecated public GroovyHookScript(String hook, @NonNull javax.servlet.ServletContext servletContext, @NonNull File jenkinsHome, @NonNull ClassLoader loader) Deprecated.
-
-
Method Details
-
bind
-
getBindings
public groovy.lang.Binding getBindings() -
run
public void run() -
execute
- Throws:
IOException
-
execute
-
execute
protected void execute(groovy.lang.GroovyCodeSource s) -
createShell
protected groovy.lang.GroovyShell createShell()Can be used to customize the environment in which the script runs.
-
GroovyHookScript(String, ServletContext, File, ClassLoader)