Currently I am having the following code in my Jenkins file
environment {
GITHUB_USER = credentials('GITHUB_USER')
GITHUB_TOKEN= credentials('GITHUB_TOKEN')
DOCKER_USER = credentials('DOCKER_USER')
ARTIFACTORY_USER = credentials('ARTIFACTORY_USER')
}
Since this code is being used in several place I want this code to be in shared library Like vars/commonCredentials.groovy
What's the best way to archive this and how can I use this in my Jenkins file?