I am struggling to populate an environment variable in a Jenkinsfile using groovy
The code below fails:
pipeline {
environment {
PACKAGE_NAME = JOB_NAME.tokenize('/')[1]
}
{
with the following error:
Environment variable values can only be joined together with ‘+’s
What am I doing wrong? Sorry if the question is basic, I am just starting with both groovy and pipelines.