How to get the jobname from jenkins

前端 未结 3 1976
余生分开走
余生分开走 2021-02-03 17:35

Is there a way to get the jobname for the current build in jenkins and pass it as a parameter to an ant build script?

3条回答
  •  温柔的废话
    2021-02-03 17:52

    You may set special variable for that based on global variable. Simple:

    THEJOB="${JOB_NAME.substring(JOB_NAME.lastIndexOf('/') + 1, JOB_NAME.length())}"
    

    Now $THEJOB is your job name

提交回复
热议问题