How to get build time stamp from Jenkins build variables?

前端 未结 10 982
余生分开走
余生分开走 2020-12-24 11:25

How can I get build time stamp of the latest build from Jenkins? I want to insert this value in the Email subject in post build actions.

10条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-24 12:17

    If you want add a timestamp to every request from browser to jenkins server. You can refer to the jenkins crumb issuer mechanism, and you can hack the /scripts/hudson-behavior.js add modify here. so it will transform a timestamp to server.

        /**
         * Puts a hidden input field to the form so that the form submission will have the crumb value
         */
        appendToForm : function(form) {
            // add here. ..... you code
            if(this.fieldName==null)    return; // noop
            var div = document.createElement("div");
            div.innerHTML = "";
            form.appendChild(div);
        }
    

提交回复
热议问题