how to get repo name in Jenkins pipeline

Viewed 24244

I'm using Jenkins Scripted Pipeline that uses Groovy style scripting, and created a Jenkinsfile to describe the pipeline. I need to create the workspace with the folder name same as git repo name, and then checkout the code in the workspace folder. My question is, before doing the checkout scm, is there a way to know the git repo name or the git repo url?

2 Answers

Maybe a silly answer, but isn't it possible using the environment Jenkins environment variable env.BITBUCKET_REPOSITORY?

Related