【问题标题】:Place a Jenkins Job inside a folder using Jenkins Job Builder使用 Jenkins Job Builder 将 Jenkins Job 放置在文件夹中
【发布时间】:2017-04-09 19:22:56
【问题描述】:

我正在尝试使用 Jenkins Job Builder 在文件夹中创建 Jenkins Job, 到目前为止没有运气;(

以下创建作业和文件夹,但作业不在文件夹内;(

请帮忙

rest-framework.yaml 的内容

- job:
name: folder_test
project-type: folder
primary-view: project_view
health-metrics:
  - worst-child-health-metric

- view:
name: project_view
view-type: list
folder: true
columns:
    - status
    - weather
    - job
    - last-success
    - last-failure
    - last-duration
regex: (?!rest-framework.*).*

- job-template:
name: '{name}-hello-world'
builders:
  - shell: 'echo "hello world!"'

- project:
name: rest-framework
jobs:
  - '{name}-hello-world'

【问题讨论】:

    标签: jenkins jenkins-job-builder


    【解决方案1】:

    为了将您创建的作业放置在文件夹中,请确保项目级别或作业级别的名称包含该文件夹。

    例子:

    - job-template:
     name: '{name}-hello-world'
    builders:
      - shell: 'echo "hello world!"'
    
    - project:
    name: folder_test/rest-framework
    jobs:
     - '{name}-hello-world'
    

    这个 sn-p 需要文件夹已经被创建(你在上面做了,但是为了简单起见这里把它删掉了)。

    已编辑:删除了说不可能的原始回复,但我进行了更多测试以使用 Jenkins-Jobs-Builder 2.0.0 找到解决方案。

    【讨论】:

      【解决方案2】:
      - job:
          name: 'end2endTestJobs'
          project-type: folder
      - job-template:
          name: 'this-is-my-job-name'
          folder: "end2endTestJobs"
      - project:
          name: my-project-name
          jobs:
            - this-is-my-job-name
      

      https://jenkins-job-builder.readthedocs.io/en/latest/project_folder.html?highlight=project

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2019-05-02
        • 1970-01-01
        • 1970-01-01
        • 2019-09-12
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多