Issue
I want to clone repo using inline groovy script in jenkins. How can I execute git clone and build the app using groovy.
Solution
If you're using Jenkins pipelines, see examples from the official href="https://jenkins.io/doc/pipeline/examples/" rel="noreferrer">documentation, e.g.:
node {
stage('Clone sources') {
git url: 'https://github.com/jfrogdev/project-examples.git'
}
}
For simple Groovy script you can try something like:
["git", "clone", "https://github.com/jfrogdev/project-examples.git"].execute()
Answered By - biruk1230
Answer Checked By - Clifford M. (JavaFixing Volunteer)