jenkins-library
Shared Library for Jenkins Pipeline
- 关于Shared Library的更多信息请参考Using libraries
配置 Jenkins 使用 Shared Library
Declarative Pipeline
Scripted Pipeline
settings.groovy
到Jenkins本地
1. 保存 - 如
/data/jenkins/config/settings.groovy
- 确保 Jenkins 运行用户有读取此文件的权限
SETTINGS
, 步骤如下:
2. 在 Jenkins 中配置全局变量 - -> Manage Jenkins
- -> Configure System
- -> Global properties
- Create new one
- Name:
SETTINGS
- Value:
/data/jenkins/config/settings.groovy
- Name:
- -> Configure System
- 具体
settings.groovy
路径请以本地环境配置为准
3. 配置 Global Pipeline Libraries
依赖项
BUILD_USER & BUILD_USER_ID 需要 build user vars 插件