Merge changes from topic '72816'
[releng/builder.git] / jjb / packaging / packaging.yaml
index 38ff5df9d7ddf5bbadb0c96cf42131e92b1b04b3..4d1c2b34a29d3953b4a82050c63474c077402d16 100644 (file)
@@ -4,8 +4,14 @@
     project-name: packaging
 
     jobs:
+      - '{project-name}-rtd-jobs':
+          build-node: centos7-builder-2c-2g
+          doc-dir: .tox/docs/tmp/html
+          project-pattern: integration/packaging
+          rtd-build-url: https://readthedocs.org/api/v2/webhook/odl-integrationpackaging/32928/
+          rtd-token: 371d63c43ad99b0745bb7779e3488c5e255c1180
       - 'packaging-build-rpm-{stream}'
-      - 'packaging-build-rpm-snap-{stream}'
+      - 'packaging-build-rpm-{distro}-snap-{stream}'
       - 'packaging-build-deb-{stream}'
       - 'packaging-verify-full-rpm-master'
       - 'packaging-verify-rpm-master'
     project: 'integration/packaging'
 
     stream:
-      - carbon
-      - nitrogen
+      - fluorine
       - oxygen
+    distro:
+      - opensuse-42
+      - epel-7
     branch: 'master'
 
     # common parameters required for 'lf-infra-deploy-maven-file' builder
@@ -59,7 +67,7 @@
       - string:
           name: DOWNLOAD_URL
           # yamllint disable-line rule:line-length
-          default: 'https://nexus.opendaylight.org/content/repositories/opendaylight.release/org/opendaylight/integration/karaf/0.7.0/karaf-0.7.0.tar.gz'
+          default: 'https://nexus.opendaylight.org/content/repositories/opendaylight.release/org/opendaylight/integration/karaf/0.8.2/karaf-0.8.2.tar.gz'
           description: 'URL to ODL tarball artifact to repackage into RPM'
       - string:
           name: CHANGELOG_NAME
           name: CHANGELOG_EMAIL
           default: 'jenkins-donotreply@opendaylight.org'
           description: 'Email of person who defined RPM'
+      - string:
+          name: DEPLOY_TO_REPO
+          default: 'opendaylight-{stream}-epel-7-x86_64-devel'
+          description: 'Repository to deploy resulting package to'
 
     scm:
       - integration-gerrit-scm:
           build-timeout: '{build-timeout}'
 
     builders:
-      - shell: !include-raw: build-rpm.sh
-      - shell: !include-raw: test-rpm-deps.sh
-      - inject:
-          properties-content: 'URL=/home/$USER/rpmbuild/RPMS/noarch/*.rpm'
-      - shell: !include-raw: install-rpm.sh
-      - shell: !include-raw: start-odl.sh
-      - shell: |
-          # Install expect to interact with Karaf shell
-          sudo yum install -y expect
-          # Install nmap to check status of ODL's SSH port
-          sudo yum install -y nmap
-      - shell: !include-raw: test-karaf.expect
-      - shell: !include-raw: stop-odl.sh
-      - shell: !include-raw: uninstall-rpm.sh
+      - shell: !include-raw-escape: build-rpm.sh
+      - install-test-uninstall-rpm
       - lf-infra-deploy-maven-file:
           global-settings-file: 'global-settings'
           settings-file: 'packaging-settings'
           mvn-version: '{mvn-version}'
-          repo-id: 'opendaylight-{stream}-epel-7-x86_64-devel'
+          repo-id: '$DEPLOY_TO_REPO'
           group-id: '{group-id}'
           upload-files-dir: '{upload-files-dir}'
           maven-repo-url: '{maven-repo-url}'
 
 
 - job-template:
-    name: 'packaging-build-rpm-snap-{stream}'
+    name: 'packaging-build-rpm-{distro}-snap-{stream}'
 
-    node: centos7-builder-2c-8g
+    node: centos7-docker-2c-8g
 
     project-type: freestyle
 
 
     builders:
       - inject:
-          properties-content: 'STREAM={stream}'
-      - shell: !include-raw: build-rpm-snap.sh
-      - shell: !include-raw: test-rpm-deps.sh
+          properties-content: |
+              STREAM={stream}
+              DISTRO={distro}
+      - shell: !include-raw: build-rpm-snap-docker.sh
+      - shell: !include-raw: test-rpm-docker.sh
       - lf-infra-deploy-maven-file:
           global-settings-file: 'global-settings'
           settings-file: 'packaging-settings'
           mvn-version: '{mvn-version}'
-          repo-id: 'opendaylight-{stream}-epel-7-x86_64-devel'
+          repo-id: 'opendaylight-{stream}-{distro}-x86_64-devel'
           group-id: '{group-id}'
           upload-files-dir: '{upload-files-dir}'
           maven-repo-url: '{maven-repo-url}'
           build-timeout: '{build-timeout}'
 
     builders:
-      # TODO: Install/test each RPM? Will require builder script changes.
-      # Test Nitrogen tarball
+      # Test Oxygen SR2 release tarball
       - inject:
           # yamllint disable-line rule:line-length
-          properties-content: 'DOWNLOAD_URL=https://nexus.opendaylight.org/content/repositories/opendaylight.release/org/opendaylight/integration/karaf/0.7.0/karaf-0.7.0.tar.gz'
-      - shell: !include-raw: build-rpm.sh
+          properties-content: 'DOWNLOAD_URL=https://nexus.opendaylight.org/content/repositories/opendaylight.release/org/opendaylight/integration/karaf/0.8.2/karaf-0.8.2.tar.gz'
+      - shell: !include-raw-escape: build-rpm.sh
+      - install-test-uninstall-rpm
 
-      # Test Oxygen pre-release autorelease tarball
+      # Test latest Oxygen snapshot
+      - inject:
+          properties-content: 'STREAM=oxygen'
+      - shell: !include-raw: build-rpm-snap.sh
+      - install-test-uninstall-rpm
+
+      # Test Fluorine pre-release autorelease tarball
+      # NB: This will need to be updated as old builds expire
       - inject:
           # yamllint disable-line rule:line-length
-          properties-content: 'DOWNLOAD_URL=https://nexus.opendaylight.org/content/repositories/autorelease-2052/org/opendaylight/integration/karaf/0.8.0/karaf-0.8.0.tar.gz'
-      - shell: !include-raw: build-rpm.sh
+          properties-content: 'DOWNLOAD_URL=https://nexus.opendaylight.org/content/repositories/autorelease-2209/org/opendaylight/integration/karaf/0.9.0/karaf-0.9.0.tar.gz'
+      - shell: !include-raw-escape: build-rpm.sh
+      - install-test-uninstall-rpm
 
-      # Test Oxygen multipatch zip (no parallel tarball available)
+      # Test Fluorine multipatch zip (no parallel tarball available)
+      # NB: This will need to be updated as old builds expire
       - inject:
           # yamllint disable-line rule:line-length
-          properties-content: 'DOWNLOAD_URL=https://nexus.opendaylight.org/content/repositories/opendaylight.snapshot/org/opendaylight/integration/integration/distribution/karaf/0.8.0-SNAPSHOT/karaf-0.8.0-20171128.175421-68.zip'
-      - shell: !include-raw: build-rpm.sh
+          properties-content: 'DOWNLOAD_URL=https://nexus.opendaylight.org/content/repositories/opendaylight.snapshot/org/opendaylight/integration/integration/distribution/karaf/0.9.0-SNAPSHOT/karaf-0.9.0-20180626.171605-65.zip'
+      - shell: !include-raw-escape: build-rpm.sh
+      - install-test-uninstall-rpm
 
-      # Test latest Oxygen snapshot
+      # Test latest Fluorine snapshot
       - inject:
-          properties-content: 'STREAM=oxygen'
+          properties-content: 'STREAM=fluorine'
       - shell: !include-raw: build-rpm-snap.sh
+      - install-test-uninstall-rpm
 
     triggers:
-      - gerrit:
-          server-name: '{gerrit-server-name}'
-          projects:
-            - project-compare-type: ANT
-              project-pattern: '{project}'
-              branches:
-                - branch-compare-type: ANT
-                  branch-pattern: '**/{branch}'
-              file-paths:
-                - compare-type: ANT
-                  pattern: 'packages/**'
+      - gerrit-trigger-patch-submitted:
+          gerrit-server-name: '{gerrit-server-name}'
+          project: '{project}'
+          branch: '{branch}'
+          files: 'packages/**'
 
     publishers:
       - lf-infra-publish
           build-timeout: '{build-timeout}'
 
     builders:
-      # Install deps needed for all tests
-      - shell: |
-          # Install expect to interact with Karaf shell
-          sudo yum install -y expect
-          # Install nmap to check status of ODL's SSH port
-          sudo yum install -y nmap
-
-      # Each new build will rm and replace this dir, only need to inject once
-      - inject:
-          properties-content: 'URL=/home/$USER/rpmbuild/RPMS/noarch/*.rpm'
-
-      # Test Carbon SR2 tarball
+      # Test Oxygen SR2 release tarball
       - inject:
           # yamllint disable-line rule:line-length
-          properties-content: 'DOWNLOAD_URL=https://nexus.opendaylight.org/content/repositories/opendaylight.release/org/opendaylight/integration/distribution-karaf/0.6.2-Carbon/distribution-karaf-0.6.2-Carbon.tar.gz'
-      - shell: !include-raw: build-rpm.sh
-      - shell: !include-raw: install-rpm.sh
-      - shell: !include-raw: start-odl.sh
-      - shell: !include-raw: test-karaf.expect
-      - shell: !include-raw: stop-odl.sh
-      - shell: !include-raw: uninstall-rpm.sh
-      - shell: |
-          # Remove old host key so future installs don't fail to SSH
-          rm /home/jenkins/.ssh/known_hosts
+          properties-content: 'DOWNLOAD_URL=https://nexus.opendaylight.org/content/repositories/opendaylight.release/org/opendaylight/integration/karaf/0.8.2/karaf-0.8.2.tar.gz'
+      - shell: !include-raw-escape: build-rpm.sh
+      - install-test-uninstall-rpm
 
-      # Test Carbon multipatch zip (no parallel tarball available)
+      # Test Oxygen pre-release autorelease tarball
       # NB: This will need to be updated as old builds expire
       - inject:
           # yamllint disable-line rule:line-length
-          properties-content: 'DOWNLOAD_URL=https://nexus.opendaylight.org/content/repositories/opendaylight.snapshot/org/opendaylight/integration/integration/distribution/distribution-karaf/0.6.3-SNAPSHOT/distribution-karaf-0.6.3-20180115.181738-1.zip'
-      - shell: !include-raw: build-rpm.sh
-      - shell: !include-raw: install-rpm.sh
-      - shell: !include-raw: start-odl.sh
-      - shell: !include-raw: test-karaf.expect
-      - shell: !include-raw: stop-odl.sh
-      - shell: !include-raw: uninstall-rpm.sh
-      - shell: |
-          # Remove old host key so future installs don't fail to SSH
-          rm /home/jenkins/.ssh/known_hosts
-
-      # Test latest Carbon snapshot
-      - inject:
-          properties-content: 'STREAM=carbon'
-      - shell: !include-raw: build-rpm-snap.sh
-      - shell: !include-raw: install-rpm.sh
-      - shell: !include-raw: start-odl.sh
-      - shell: !include-raw: test-karaf.expect
-      - shell: !include-raw: stop-odl.sh
-      - shell: !include-raw: uninstall-rpm.sh
-      - shell: |
-          # Remove old host key so future installs don't fail to SSH
-          rm /home/jenkins/.ssh/known_hosts
-
-      # Test Nitrogen tarball
-      - inject:
-          # yamllint disable-line rule:line-length
-          properties-content: 'DOWNLOAD_URL=https://nexus.opendaylight.org/content/repositories/opendaylight.release/org/opendaylight/integration/karaf/0.7.0/karaf-0.7.0.tar.gz'
-      - shell: !include-raw: build-rpm.sh
-      - shell: !include-raw: install-rpm.sh
-      - shell: !include-raw: start-odl.sh
-      - shell: !include-raw: test-karaf.expect
-      - shell: !include-raw: stop-odl.sh
-      - shell: !include-raw: uninstall-rpm.sh
-      - shell: |
-          # Remove old host key so future installs don't fail to SSH
-          rm /home/jenkins/.ssh/known_hosts
-
-      # Test Nitrogen SR1 tarball
-      - inject:
-          # yamllint disable-line rule:line-length
-          properties-content: 'DOWNLOAD_URL=https://nexus.opendaylight.org/content/repositories/opendaylight.release/org/opendaylight/integration/karaf/0.7.1/karaf-0.7.1.tar.gz'
-      - shell: !include-raw: build-rpm.sh
-      - shell: !include-raw: install-rpm.sh
-      - shell: !include-raw: start-odl.sh
-      - shell: !include-raw: test-karaf.expect
-      - shell: !include-raw: stop-odl.sh
-      - shell: !include-raw: uninstall-rpm.sh
-      - shell: |
-          # Remove old host key so future installs don't fail to SSH
-          rm /home/jenkins/.ssh/known_hosts
+          properties-content: 'DOWNLOAD_URL=https://nexus.opendaylight.org/content/repositories/autorelease-2210/org/opendaylight/integration/karaf/0.8.3/karaf-0.8.3.tar.gz'
+      - shell: !include-raw-escape: build-rpm.sh
+      - install-test-uninstall-rpm
 
-      # Test Nitrogen multipatch zip (no parallel tarball available)
+      # Test Oxygen multipatch zip (no parallel tarball available)
       # NB: This will need to be updated as old builds expire
       - inject:
           # yamllint disable-line rule:line-length
-          properties-content: 'DOWNLOAD_URL=https://nexus.opendaylight.org/content/repositories/opendaylight.snapshot/org/opendaylight/integration/integration/distribution/karaf/0.7.2-SNAPSHOT/karaf-0.7.2-20180115.183312-2.zip'
-      - shell: !include-raw: build-rpm.sh
-      - shell: !include-raw: install-rpm.sh
-      - shell: !include-raw: start-odl.sh
-      - shell: !include-raw: test-karaf.expect
-      - shell: !include-raw: stop-odl.sh
-      - shell: !include-raw: uninstall-rpm.sh
-      - shell: |
-          # Remove old host key so future installs don't fail to SSH
-          rm /home/jenkins/.ssh/known_hosts
+          properties-content: 'DOWNLOAD_URL=https://nexus.opendaylight.org/content/repositories/opendaylight.snapshot/org/opendaylight/integration/integration/distribution/karaf/0.8.3-SNAPSHOT/karaf-0.8.3-20180627.184938-10.zip'
+      - shell: !include-raw-escape: build-rpm.sh
+      - install-test-uninstall-rpm
 
-      # Test latest Nitrogen snapshot
+      # Test latest Oxygen snapshot
       - inject:
-          properties-content: 'STREAM=nitrogen'
+          properties-content: 'STREAM=oxygen'
       - shell: !include-raw: build-rpm-snap.sh
-      - shell: !include-raw: install-rpm.sh
-      - shell: !include-raw: start-odl.sh
-      - shell: !include-raw: test-karaf.expect
-      - shell: !include-raw: stop-odl.sh
-      - shell: !include-raw: uninstall-rpm.sh
-      - shell: |
-          # Remove old host key so future installs don't fail to SSH
-          rm /home/jenkins/.ssh/known_hosts
+      - install-test-uninstall-rpm
 
-      # Test Oxygen pre-release autorelease tarball
+      # Test Fluorine pre-release autorelease tarball
       # NB: This will need to be updated as old builds expire
       - inject:
           # yamllint disable-line rule:line-length
-          properties-content: 'DOWNLOAD_URL=https://nexus.opendaylight.org/content/repositories/autorelease-2052/org/opendaylight/integration/karaf/0.8.0/karaf-0.8.0.tar.gz'
-      - shell: !include-raw: build-rpm.sh
-      - shell: !include-raw: install-rpm.sh
-      - shell: !include-raw: start-odl.sh
-      - shell: !include-raw: test-karaf.expect
-      - shell: !include-raw: stop-odl.sh
-      - shell: !include-raw: uninstall-rpm.sh
-      - shell: |
-          # Remove old host key so future installs don't fail to SSH
-          rm /home/jenkins/.ssh/known_hosts
+          properties-content: 'DOWNLOAD_URL=https://nexus.opendaylight.org/content/repositories/autorelease-2209/org/opendaylight/integration/karaf/0.9.0/karaf-0.9.0.tar.gz'
+      - shell: !include-raw-escape: build-rpm.sh
+      - install-test-uninstall-rpm
 
-      # Test Oxygen multipatch zip (no parallel tarball available)
-      # FIXME: Something is wrong with current Oxygen multipatch builds
+      # Test Fluorine multipatch zip (no parallel tarball available)
       # NB: This will need to be updated as old builds expire
-      # - inject:
-      # yamllint disable-line rule:line-length
-      #     properties-content: 'DOWNLOAD_URL=https://nexus.opendaylight.org/content/repositories/opendaylight.snapshot/org/opendaylight/integration/integration/distribution/karaf/0.8.0-SNAPSHOT/karaf-0.8.0-20180111.030942-90.zip'
-      # - shell: !include-raw: build-rpm.sh
-      # - shell: !include-raw: install-rpm.sh
-      # - shell: !include-raw: start-odl.sh
-      # - shell: !include-raw: test-karaf.expect
-      # - shell: !include-raw: stop-odl.sh
-      # - shell: !include-raw: uninstall-rpm.sh
-      # - shell: |
-      #     Remove old host key so future installs don't fail to SSH
-      #     rm /home/jenkins/.ssh/known_hosts
+      - inject:
+          # yamllint disable-line rule:line-length
+          properties-content: 'DOWNLOAD_URL=https://nexus.opendaylight.org/content/repositories/opendaylight.snapshot/org/opendaylight/integration/integration/distribution/karaf/0.9.0-SNAPSHOT/karaf-0.9.0-20180626.171605-65.zip'
+      - shell: !include-raw-escape: build-rpm.sh
+      - install-test-uninstall-rpm
 
-      # Test latest Oxygen snapshot
+      # Test latest Fluorine snapshot
       - inject:
-          properties-content: 'STREAM=oxygen'
+          properties-content: 'STREAM=fluorine'
       - shell: !include-raw: build-rpm-snap.sh
-      - shell: !include-raw: install-rpm.sh
-      - shell: !include-raw: start-odl.sh
-      - shell: !include-raw: test-karaf.expect
-      - shell: !include-raw: stop-odl.sh
-      - shell: !include-raw: uninstall-rpm.sh
-      - shell: |
-          # Remove old host key so future installs don't fail to SSH
-          rm /home/jenkins/.ssh/known_hosts
+      - install-test-uninstall-rpm
 
     triggers:
       - timed: '@daily'
       - string:
           name: URL
           # yamllint disable-line rule:line-length
-          default: 'https://git.opendaylight.org/gerrit/gitweb?p=integration/packaging.git;a=blob_plain;f=packages/rpm/example_repo_configs/opendaylight-8-devel.repo'
+          default: 'https://git.opendaylight.org/gerrit/gitweb?p=integration/packaging.git;a=blob_plain;f=packages/rpm/example_repo_configs/opendaylight-9-devel.repo'
           description: 'Link to .repo or .rpm file'
 
     scm:
           build-timeout: '{build-timeout}'
 
     builders:
-      - shell: !include-raw: install-rpm.sh
-      - shell: !include-raw: start-odl.sh
       - shell: |
           # Install expect to interact with Karaf shell
-          sudo yum install -y expect
           # Install nmap to check status of ODL's SSH port
-          sudo yum install -y nmap
-      - shell: !include-raw: test-karaf.expect
+          sudo yum install -y expect nmap
+      - shell: !include-raw-escape: install-rpm.sh
+      - shell: !include-raw: start-odl.sh
+      - shell: !include-raw-escape: test-ports-nofeature.sh
+      - shell: !include-raw: test-karaf-oxygensafe.expect
+      # Disable this test until ODLPARENT-139 is fixed
+      # - shell: !include-raw-escape: test-rest-ok.sh
       - shell: !include-raw: stop-odl.sh
       - shell: !include-raw: uninstall-rpm.sh
 
       - string:
           name: URL
           # yamllint disable-line rule:line-length
-          default: 'https://raw.githubusercontent.com/opendaylight/integration-packaging/master/packages/rpm/example_repo_configs/opendaylight-7-release.repo'
+          default: 'https://raw.githubusercontent.com/opendaylight/integration-packaging/master/packages/rpm/example_repo_configs/opendaylight-8-release.repo'
           description: 'Link to .repo or .rpm file'
       - string:
           name: UPGRADE_URL
           # yamllint disable-line rule:line-length
-          default: 'https://raw.githubusercontent.com/opendaylight/integration-packaging/master/packages/rpm/example_repo_configs/opendaylight-7-devel.repo'
+          default: 'https://raw.githubusercontent.com/opendaylight/integration-packaging/master/packages/rpm/example_repo_configs/opendaylight-8-devel.repo'
           description: 'Link to .repo or .rpm file'
 
     scm:
           build-timeout: '{build-timeout}'
 
     builders:
-      - shell: !include-raw: install-rpm.sh
+      - shell: !include-raw-escape: install-rpm.sh
       - shell: !include-raw: start-odl.sh
       - shell: |
           # Install expect to interact with Karaf shell
           sudo yum install -y expect
           # Install nmap to check status of ODL's SSH port
           sudo yum install -y nmap
-      - shell: !include-raw: test-karaf.expect
+      - shell: !include-raw: test-karaf-oxygensafe.expect
       - shell: !include-raw: stop-odl.sh
       - shell: !include-raw: test-rpm-upgrade.sh
       - shell: !include-raw: start-odl.sh
-      - shell: !include-raw: test-karaf.expect
+      - shell: !include-raw: test-karaf-oxygensafe.expect
       - shell: !include-raw: stop-odl.sh
       - shell: !include-raw: uninstall-rpm.sh
 
           artifacts: '{archive-artifacts}'
       - string:
           name: PACKAGE
-          default: 'ppa:odl-team/carbon'
+          default: 'ppa:odl-team/oxygen'
           description: 'Link to .deb package or name of PPA repo'
 
     scm:
           build-timeout: '{build-timeout}'
 
     builders:
-      - shell: !include-raw: install-deb.sh
+      - shell: !include-raw-escape: install-deb.sh
       - shell: !include-raw: start-odl.sh
+      - shell: !include-raw-escape: test-ports-nofeature.sh
       - shell: |
           # Install expect to interact with Karaf shell
-          sudo apt-get install -y expect
           # Install nmap to check status of ODL's SSH port
-          sudo apt-get install -y nmap
-      - shell: !include-raw: test-karaf.expect
+          sudo apt-get install -y expect nmap
+      - shell: !include-raw: test-karaf-oxygensafe.expect
+      # Disable this test until ODLPARENT-139 is fixed
+      # - shell: !include-raw-escape: test-rest-ok.sh
       - shell: !include-raw: stop-odl.sh
+      - shell: !include-raw-escape: uninstall-deb.sh
 
     publishers:
       - lf-infra-publish
 
     builders:
       - shell: !include-raw: build-deb.sh
+      - install-test-uninstall-deb
       - lf-infra-deploy-maven-file:
           global-settings-file: 'global-settings'
           settings-file: 'packaging-settings'
 
     publishers:
       - lf-infra-publish
+
+- view:
+    name: packaging
+    description: 'List of packaging, ansible and puppet jobs'
+    regex: '^packaging.*|ansible.*|puppet.*'
+    <<: *releng_view_common