Getting current timestamp in inline pipeline script using pipeline plugin of hudson

前端 未结 5 885
天命终不由人
天命终不由人 2021-01-01 17:02

I want to get Getting current timestamp in inline pipeline script using pipeline plugin of hudson. For setting up build display name.

Inline groovy script used:

5条回答
  •  孤城傲影
    2021-01-01 17:41

    Jenkins scripts are running in a sandbox, by default the Groovy script doesn't have permissions for some operations.

    When you perform an operation without permissions the RejectAccessException is thrown. So you've to execute your script, and then when the exception is thrown go to:

    http://yourHost/jenkins/scriptApproval/
    

    And approve the necessary permission:

提交回复
热议问题