How to display the time it took to run a build in Jenkins?

前端 未结 5 1637
难免孤独
难免孤独 2021-01-12 03:14

I\'m configuring a process of Android application build by using Jenkins pipeline.

At the beginning and the end of the build, a message is sent to a relevant Slack c

5条回答
  •  刺人心
    刺人心 (楼主)
    2021-01-12 04:01

    You can use ${currentBuild.durationString} to get it formatted in a human-readable format (n minutes n seconds). However it will be prefixed with and counting which is kinda weird.

    So I followed this ${currentBuild.durationString.replace(' and counting', '')}

提交回复
热议问题