How to get the jobname from jenkins

前端 未结 3 1975
余生分开走
余生分开走 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:49

    Jenkins sets some environment variables such as JOB_NAME (see here) for more details on the variables set.

    You can then access these in ant via ${env.JOB_NAME}.

    Edit: There's also a little howto for environment variables on the same page here.

提交回复
热议问题