1、定时编译:
https://www.cnblogs.com/zsg88/p/9178625.html
2、BUILD_USER
https://plugins.jenkins.io/build-user-vars-plugin
参考:https://blog.csdn.net/nklinsirui/article/details/100524304
3、获取timer:定时编译
https://stackoverflow.com/questions/43597803/how-to-differentiate-build-triggers-in-jenkins-pipeline
pipeline代码:
def buildCause = currentBuild.getBuildCauses()[0].shortDescription
echo "buildCause = ${buildCause}"
结果:
[Pipeline] echo
buildCause = Started by timer
4、pipeline读取配置文件:
5、jenkins环境变量的使用
environment { HTTPD_LOCATION = "" }
然后在stage里赋值HTTPD_LOCATION = "/home/httpd/www/html",不然这个环境变量不好用
原因:暂时不知道为什么不能直接赋值