MYHOSPITALNOW.COM

Find Trusted Doctors & Hospitals

Discover healthcare providers, compare hospitals, and explore treatment options worldwide.

Free Treatment Quotes • Doctor Search • Hospital Comparison

Find Healthcare Options

www.myhospitalnow.com

How to run/execute groovy script in Jenkins?

ScmGalaxy banner: How to run/execute groovy script in Jenkins, with Jenkins and Groovy logos

Here are the List of way using you can apply grovy code in Jenkins

Method -1: Groovy plugin
This plugin adds the ability to directly execute Groovy code.
More info – https://wiki.jenkins.io/display/JENKINS/Groovy+plugin

Method -2: Jenkins script console
The inbuilt script console is a very useful and powerful Jenkins extension and ideally suits certain types of tasks. This simple but powerful built-in web console allows you to run Groovy scripts on your Jenkins instance (or its slave nodes) from directly within the user interface, and is installed as standard.

To access the console, either navigate to Manage Jenkins and then select Script Console, or simply append /script to your Jenkins host and port, like this for example: http://jenkinshost:8080/script
Running Script Console on the master
This feature can be accessed from “Manage Jenkins” > “Script Console”. Or visit the sub-URL /script on your Jenkins instance.

Running Script Console on agents
Visit “Manage Jenkins” > “Manage Nodes”. Select any node to view the status page. In the menu on the left, a menu item is available to open a “Script Console” on that specific agent.

More info – https://wiki.jenkins.io/display/JENKINS/Jenkins+Script+Console

Method -3: Scriptler Plugins
Scriptler allows you to store/edit groovy scripts and execute it on any of the slaves/nodes… no need to copy/paste groovy code anymore.
More Info – https://wiki.jenkins.io/display/JENKINS/Scriptler+Plugin

Reference

https://wiki.jenkins.io/display/JENKINS/Jenkins+Script+Console

 

Find Trusted Cardiac Hospitals

Compare heart hospitals by city and services — all in one place.

Explore Hospitals
I'm Rajesh Kumar, a DevOps, SRE, DevSecOps, Cloud, and Platform Engineering expert passionate about sharing practical knowledge, real-world experiences, and industry best practices. I have worked at Cotocus and regularly write about technology, travel, investing, health, product reviews, and digital marketing through my various platforms. I publish technical articles at DevOps School, travel stories at Holiday Landmark, stock market insights at Stocks Mantra, health and fitness guidance at My Medic Plus, product reviews at TrueReviewNow, and SEO and digital marketing strategies at Wizbrand.

Related Posts

Jenkins Tutorials: Meaning of $class in scripted pipeline

In Jenkins pipeline scripts, the $class parameter is used to specify the class or type of an object. The complete list of $class values depends on the…

Read More

Database of Groovy Script for Jenkins Automation

Here are the list of Groovy Script which can be used in Jenkins to automate the JOBs and CI process. Please add your list in the comment…

Read More

Cloudbees CD RO Tutorials: DSL

CloudBees CD/RO DSL is a Groovy-based language for defining projects, procedures, steps, pipelines and properties as code. You run these scripts on the server with ectool evalDsl….

Read More

Groovy Tutorials: How to write comments in Groovy?

Groovy has three kinds of comment that it shares with Java: single-line comments with //, block comments between /* and */, and GroovyDoc comments between /** and…

Read More

Automating Jenkins Job Configuration: Job DSL, Multibranch, Job Generator, and JJB

Manually creating many Jenkins jobs is slow and error-prone. This guide compares the main automation options and shows practical jobs-as-code examples for repeatable setup.

Read More

Jenkins at Scale: Practical References and Admin Cheatsheet

This revised guide upgrades a short 2015 Jenkins link post into an operations-ready reference for teams running Jenkins at scale. It preserves the original links and adds a workflow diagram, comparison table, and practical API/CLI examples.

Read More
Subscribe
Notify of
guest
1 Comment
Newest
Oldest Most Voted
trackback
Internal - Yesha
4 years ago

[…] Jenkins supports groovy script execution. I found this article execute groovy script in Jenkins […]

1
0
Would love your thoughts, please comment.x
()
x