Jenkins Job Builder没有创build发布者

希望有人能帮忙 – 我和JJB有一个噩梦。

如果我从我的JJB yaml脚本中注释出版商,它会将任务build立好 – 只要我将任何发布者添加到项目中的任何任务中,我都会收到以下错误:

为组件typesfind重复的入口点:'publisher','publisher',name:

完整的错误

Traceback (most recent call last): File "/usr/local/bin/jenkins-jobs", line 11, in <module> sys.exit(main()) File "/usr/local/lib/python2.7/site-packages/jenkins_jobs/cmd.py", line 191, in main execute(options, config) File "/usr/local/lib/python2.7/site-packages/jenkins_jobs/cmd.py", line 372, in execute n_workers=options.n_workers) File "/usr/local/lib/python2.7/site-packages/jenkins_jobs/builder.py", line 350, in update_jobs self.parser.generateXML() File "/usr/local/lib/python2.7/site-packages/jenkins_jobs/parser.py", line 342, in generateXML self.xml_jobs.append(self.getXMLForJob(job)) File "/usr/local/lib/python2.7/site-packages/jenkins_jobs/parser.py", line 352, in getXMLForJob self.gen_xml(xml, data) File "/usr/local/lib/python2.7/site-packages/jenkins_jobs/parser.py", line 359, in gen_xml module.gen_xml(self, xml, data) File "/usr/local/lib/python2.7/site-packages/jenkins_jobs/modules/publishers.py", line 6158, in gen_xml self.registry.dispatch('publisher', parser, publishers, action) File "/usr/local/lib/python2.7/site-packages/jenkins_jobs/registry.py", line 218, in dispatch "name: '{1}'".format(component_type, name)) jenkins_jobs.errors.JenkinsJobsException: Duplicate entry point found for component type: 'publisher', 'publisher',name: 'trigger' 

我的configuration如下:

1Xjenkins容器:最新

1个JJB容器

  FROM python:2.7-alpine # add JJB configs USER root RUN mkdir /jobs/ COPY ./jjb-staticgen/ /jobs/ # install software ENV BUILD_DEPS \ git \ py-pip \ py-virtualenv \ #test yaml-dev RUN apk update && apk add --no-cache $BUILD_DEPS && \ pip install --upgrade pip && \ pip install -r /jobs/requirements.txt && \ # set jobs cache for jenkins job builder ENV XDG_CACHE_HOME /jobs VOLUME /jobs WORKDIR /jobs CMD ["jenkins-jobs", "--conf", "/jobs/jenkins_jobs.ini", "update", "."] 

Requirements.txt:

  six>=1.9.0 PyYAML>=3.10.0 pbr>=1.8 stevedore>=1.17.1 python-jenkins>=0.4.8 yamllint jenkins-job-builder==1.6.2 jenkins-jobs-slack 

jobs.ini

  [job_builder] ignore_cache=True keep_descriptions=False recursive=False allow_duplicates=True [jenkins] user=jenkins password=cccccccccccc url=http://ccc.ccc.com:8080/ query_plugins_info=False 

示例任务 – 这些正在为三个不同的项目构build

  - job-template: name: '{name}-publish-cloud' description: 'Build and deploy a single article via cloud funtion.' concurrent: true defaults: global properties: - priority-sorter: priority: 800 - inject: properties-file: '{env-properties-file}' properties-content: | PROJECT_NAME={name} FUNCTION_S3_LOCATION={function_s3_location} FUNCTION_GCS_LOCATION={function_gcs_location} FUNCTION_URL={function_url_publish} FUNCTION_PACKAGE_NAME={function_package_name} GRAPH_URL={graph_url} - slack: notify-failure: true notify-backtonormal: true show-commit-list: true room: 'static-content' token: $SLACK_TOKEN team-domain: 'team' build-server-url: 'http://ccc.ccc.com' notify-success: false notify-start: false notify-aborted: false notify-notbuilt: false notify-unstable: false notify-repeatedfailure: false include-test-summary: false include-custom-message: false parameters: - string: name: ENTITY_ID description: "The id of the document we are working on." builders: - shell: !include-raw-escape: './bin/environment-dump.sh' - shell: !include-raw-escape: './bin/publish-function.sh' # If i uncomment these JJB breaks # publishers: # - trigger: # project: '{name}-front-matter' # - slack: # include-custom-message: True # custom-message: 'BETA CHANNEL' 

示例工作组:

  - job-group: name: 'static-jobs' jobs: - '{name}-front-matter' #- '{name}-front-matter-update' #- '{name}-build-resource' - '{name}-build-homepage' #- '{name}-update-site-frame' - '{name}-publish-cloud'