/jenkins-library

Shared Library for Jenkine Pipeline

Primary LanguageGroovyApache License 2.0Apache-2.0

jenkins-library

Shared Library for Jenkins Pipeline

配置 Jenkins 使用 Shared Library

Declarative Pipeline

Scripted Pipeline

1. 保存 settings.groovy 到Jenkins本地

  • /data/jenkins/config/settings.groovy
  • 确保 Jenkins 运行用户有读取此文件的权限

2. 在 Jenkins 中配置全局变量 SETTINGS, 步骤如下:

  • -> Manage Jenkins
    • -> Configure System
      • -> Global properties
      • Create new one
        • Name: SETTINGS
        • Value: /data/jenkins/config/settings.groovy
  • 具体 settings.groovy 路径请以本地环境配置为准

3. 配置 Global Pipeline Libraries

依赖项

BUILD_USER & BUILD_USER_ID 需要 build user vars 插件