Use release credential in pypi release merge 12/62012/7
authorLott, Christopher (cl778h) <cl778h@att.com>
Wed, 16 Oct 2019 21:26:47 +0000 (17:26 -0400)
committerLott, Christopher (cl778h) <cl778h@att.com>
Thu, 17 Oct 2019 01:30:38 +0000 (21:30 -0400)
Add macro with lf-infra-wrappers block to set jenkins-ssh-credential
parameter to the value in parameter jenkins-ssh-release-credential,
which makes the PyPI release merge templates parallel to the release-job
merge template.  Both need privileges to push a tag from Jenkins.
Document the revised configuration parameter. Silence yamllint issues.

Change-Id: I534c659ec4c5165184bc1de8bb7021dab116deab
Issue-Id: RELENG-2317
Signed-off-by: Lott, Christopher (cl778h) <cl778h@att.com>
docs/jjb/lf-python-jobs.rst
jjb/lf-python-jobs.yaml
releasenotes/notes/add-pypi-ssh-release-credential-722955d749779d56.yaml [new file with mode: 0644]

index 8f4f6bd..c87e780 100644 (file)
@@ -651,7 +651,7 @@ The special parameters are as follows::
 :Required Parameters:
 
     :build-node: The node to run build on, which must be Centos.
-    :jenkins-ssh-credential: Credential to use for SSH. (Generally set
+    :jenkins-ssh-release-credential: Credential to use for SSH. (Generally set
         in defaults.yaml)
 
 :Optional Parameters:
index b334c78..a0f818e 100644 (file)
     java-version: openjdk8
     nexus-iq-cli-version: 1.44.0-01
     nexus-iq-namespace: "" # Recommend a trailing dash when set. Example: odl-
-    pre-build-script: "# pre-build script goes here"
+    pre-build-script: "  # pre-build script goes here"
     stream: master
     submodule-recursive: true
     submodule-timeout: 10
     name: "{project-name}-python-clm-{stream}"
     id: gerrit-python-xc-clm
     <<: *lf_python_common
-    # yamllint disable-line rule:key-duplicates
     <<: *lf_python_xc_clm
 
     ######################
     name: "{project-name}-python-clm-{stream}"
     id: github-python-xc-clm
     <<: *lf_python_common
-    # yamllint disable-line rule:key-duplicates
     <<: *lf_python_xc_clm
 
     properties:
                 mvn-settings: "{mvn-settings}"
                 mvn-version: "{mvn-version}"
                 sonarcloud-project-key: "{sonarcloud-project-key}"
+                # yamllint disable-line rule:line-length
                 sonarcloud-project-organization: "{sonarcloud-project-organization}"
                 sonarcloud-api-token: "{sonarcloud-api-token}"
       # With SonarQube
     name: "{project-name}-tox-sonar"
     id: gerrit-tox-sonar
     <<: *lf_python_common
-    # yamllint disable-line rule:key-duplicates
     <<: *lf_tox_sonar
 
     ######################
     name: "{project-name}-tox-sonar"
     id: github-tox-sonar
     <<: *lf_python_common
-    # yamllint disable-line rule:key-duplicates
     <<: *lf_tox_sonar
 
     properties:
     # Default parameters #
     ######################
 
+    archive-artifacts: >
+      **/*.log
     branch: master
     build-days-to-keep: 7
     build-timeout: 15
     tox-dir: "."
     tox-envs: ""
 
-    disabled: "{disable-job}"
-
     gerrit_trigger_file_paths:
       - compare-type: ANT
         pattern: ".*"
     github_included_regions:
       - ".*"
 
+    #####################
+    # Job Configuration #
+    #####################
+
+    project-type: freestyle
+    node: "{build-node}"
+    disabled: "{disable-job}"
+
+    properties:
+      - lf-infra-properties:
+          build-days-to-keep: "{build-days-to-keep}"
+
     parameters:
       - lf-infra-parameters:
           project: "{project}"
           description: |
             If DRY_RUN is enabled artifacts are not published.
 
+    publishers:
+      - lf-infra-publish
+
+- lf_pypi_common_wrappers: &lf_pypi_common_wrappers
+    name: lf-pypi-common-wrappers
+
+    wrappers:
+      - lf-infra-wrappers:
+          build-timeout: "{build-timeout}"
+          jenkins-ssh-credential: "{jenkins-ssh-credential}"
+
+- lf_pypi_release_wrappers: &lf_pypi_release_wrappers
+    name: lf-pypi-release-wrappers
+
+    wrappers:
+      - lf-infra-wrappers:
+          build-timeout: "{build-timeout}"
+          jenkins-ssh-credential: "{jenkins-ssh-release-credential}"
+
 - lf_pypi_verify_builders: &lf_pypi_verify_builders
     name: lf-pypi-verify-builders
 
 - job-template:
     name: "{project-name}-pypi-verify-{stream}"
     id: gerrit-pypi-verify
-    <<: *lf_python_common
-    # yamllint disable-line rule:key-duplicates
     <<: *lf_pypi_common
+    <<: *lf_pypi_common_wrappers
     <<: *lf_pypi_verify_builders
 
     scm:
                 exclude-no-code-change: false
             - draft-published-event
             - comment-added-contains-event:
+                # yamllint disable-line rule:line-length
                 comment-contains-value: '^Patch Set\s+\d+:\s+(recheck|reverify)\s*$'
           projects:
             - project-compare-type: ANT
 - job-template:
     name: "{project-name}-pypi-verify-{stream}"
     id: github-pypi-verify
-    <<: *lf_python_common
-    # yamllint disable-line rule:key-duplicates
     <<: *lf_pypi_common
+    <<: *lf_pypi_common_wrappers
     <<: *lf_pypi_verify_builders
 
     properties:
 - job-template:
     name: "{project-name}-pypi-merge-{stream}"
     id: gerrit-pypi-merge
-    <<: *lf_python_common
-    # yamllint disable-line rule:key-duplicates
     <<: *lf_pypi_common
+    <<: *lf_pypi_common_wrappers
     <<: *lf_pypi_merge_builders
 
     cron: ""
 - job-template:
     name: "{project-name}-pypi-merge-{stream}"
     id: github-pypi-merge
-    <<: *lf_python_common
-    # yamllint disable-line rule:key-duplicates
     <<: *lf_pypi_common
+    <<: *lf_pypi_common_wrappers
     <<: *lf_pypi_merge_builders
 
     cron: ""
       - compare-type: REG_EXP
         pattern: '(releases\/.*\.yaml|\.releases\/.*\.yaml)'
 
+    # yamllint disable-line rule:line-length
     # github_release_included_regions MUST match gerrit_release_trigger_file_paths
     github_release_included_regions:
       - 'releases\/.*\.yaml'
 - job-template:
     name: "{project-name}-pypi-release-verify-{stream}"
     id: gerrit-pypi-release-verify
-    <<: *lf_python_common
-    # yamllint disable-line rule:key-duplicates
     <<: *lf_pypi_common
+    <<: *lf_pypi_common_wrappers
     <<: *lf_pypi_release_common
     <<: *lf_pypi_release_verify_builders
 
                 exclude-no-code-change: false
             - draft-published-event
             - comment-added-contains-event:
+                # yamllint disable-line rule:line-length
                 comment-contains-value: '^Patch Set\s+\d+:\s+(recheck|reverify)\s*$'
           projects:
             - project-compare-type: "ANT"
 - job-template:
     name: "{project-name}-pypi-release-verify-{stream}"
     id: github-pypi-release-verify
-    <<: *lf_python_common
-    # yamllint disable-line rule:key-duplicates
     <<: *lf_pypi_common
+    <<: *lf_pypi_common_wrappers
     <<: *lf_pypi_release_common
     <<: *lf_pypi_release_verify_builders
 
 - job-template:
     name: "{project-name}-pypi-release-merge-{stream}"
     id: gerrit-pypi-release-merge
-    <<: *lf_python_common
-    # yamllint disable-line rule:key-duplicates
     <<: *lf_pypi_common
+    <<: *lf_pypi_release_wrappers
     <<: *lf_pypi_release_common
     <<: *lf_pypi_release_merge_builders
 
 - job-template:
     name: "{project-name}-pypi-release-merge-{stream}"
     id: github-pypi-release-merge
-    <<: *lf_python_common
-    # yamllint disable-line rule:key-duplicates
     <<: *lf_pypi_common
+    <<: *lf_pypi_release_wrappers
     <<: *lf_pypi_release_common
     <<: *lf_pypi_release_merge_builders
 
diff --git a/releasenotes/notes/add-pypi-ssh-release-credential-722955d749779d56.yaml b/releasenotes/notes/add-pypi-ssh-release-credential-722955d749779d56.yaml
new file mode 100644 (file)
index 0000000..45d8008
--- /dev/null
@@ -0,0 +1,8 @@
+---
+fixes:
+  - |
+    Add macro with lf-infra-wrappers block to set jenkins-ssh-credential
+    parameter to the value in parameter jenkins-ssh-release-credential,
+    which makes the PyPI release merge templates parallel to the release-job
+    merge template.  Both need privileges to push a tag on the Jenkins minion.
+    Document the revised configuration parameter. Silence yamllint issues.