]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-build.git/commitdiff
cephadm-ansible-prs: add multi-distro support 2009/head
authorGuillaume Abrioux <gabrioux@redhat.com>
Thu, 19 May 2022 15:24:21 +0000 (17:24 +0200)
committerGuillaume Abrioux <gabrioux@redhat.com>
Thu, 19 May 2022 15:41:20 +0000 (17:41 +0200)
So we can test against multiple distro.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
cephadm-ansible-prs/build/build
cephadm-ansible-prs/config/definitions/cephadm-ansible-prs.yml

index cb570e9bcdb4049104af5bfbf806af8e8287f172..dc26f8e380ec40ebbde81ad173f254fe3dc6b87b 100644 (file)
@@ -19,4 +19,10 @@ update_vagrant_boxes
 
 rm -rf "${HOME}"/ansible/facts/*
 
-"${VENV}"/tox --workdir="${TEMPVENV}" -c tox.ini -r -v -- --provider=libvirt
+if [[ -n "$DISTRIBUTION" ]]; then
+  ENVIRONMENT="${DISTRIBUTION}"-"${SCENARIO}"
+else
+  ENVIRONMENT="${SCENARIO}"
+fi
+
+"${VENV}"/tox --workdir="${TEMPVENV}" -c tox.ini -e "${ENVIRONMENT}" -r -v -- --provider=libvirt
index 89495fdbf71fc31c31dc452a8b6e959d4c12914d..9e50cf40e454a8db764f6c5bfee9a9813663cd30 100644 (file)
@@ -1,14 +1,26 @@
 - project:
-    name: cephadm-ansible-prs-smithi
+    name: cephadm-ansible-prs-syntax
     worker_labels: 'vagrant && libvirt && (braggi || adami)'
     scenario:
-      - tox
+      - flake8
+      - mypy
     jobs:
-      - 'cephadm-ansible-prs-auto'
+      - 'cephadm-ansible-prs-syntax'
+
+- project:
+    name: cephadm-ansible-prs-functional
+    worker_labels: 'vagrant && libvirt && (braggi || adami)'
+    distribution:
+      - el8
+      - el9
+    scenario:
+      - functional
+    jobs:
+      - 'cephadm-ansible-prs-functional'
 
 - job-template:
     name: 'cephadm-ansible-prs-{scenario}'
-    id: 'cephadm-ansible-prs-auto'
+    id: 'cephadm-ansible-prs-syntax'
     node: '{worker_labels}'
     concurrent: true
     defaults: global
       - inject-passwords:
           global: true
           mask-password-params: true
+
+- job-template:
+    name: 'cephadm-ansible-prs-{distribution}-{scenario}'
+    id: 'cephadm-ansible-prs-functional'
+    node: '{worker_labels}'
+    concurrent: true
+    defaults: global
+    display-name: 'cephadm-ansible: Pull Requests [{distribution}-{scenario}]'
+    quiet-period: 5
+    block-downstream: false
+    block-upstream: false
+    retry-count: 3
+    properties:
+      - github:
+          url: https://github.com/ceph/cephadm-ansible
+      - build-discarder:
+          days-to-keep: 90
+          num-to-keep: -1
+          artifact-days-to-keep: -1
+          artifact-num-to-keep: -1
+
+    parameters:
+      - string:
+          name: sha1
+          description: "A pull request ID, like 'origin/pr/72/head'"
+
+    triggers:
+      - github-pull-request:
+          cancel-builds-on-update: true
+          allow-whitelist-orgs-as-admins: true
+          org-list:
+            - ceph
+          skip-build-phrase: '^jenkins do not test.*|.*\[skip ci\].*'
+          trigger-phrase: '^jenkins test {distribution}-{scenario}|jenkins test all.*'
+          only-trigger-phrase: false
+          github-hooks: true
+          permit-all: true
+          auto-close-on-fail: false
+          status-context: "Testing: {distribution}-{scenario}"
+          started-status: "Running: {distribution}-{scenario}"
+          success-status: "OK - {distribution}-{scenario}"
+          failure-status: "FAIL - {distribution}-{scenario}"
+
+    scm:
+      - git:
+          url: https://github.com/ceph/cephadm-ansible.git
+          branches:
+            - ${{sha1}}
+          refspec: +refs/pull/*:refs/remotes/origin/pr/*
+          browser: auto
+          timeout: 20
+          skip-tag: true
+          wipe-workspace: false
+
+    builders:
+      - inject:
+          properties-content: |
+            DISTRIBUTION={distribution}
+            SCENARIO={scenario}
+      - conditional-step:
+          condition-kind: shell
+          condition-command: |
+            #!/bin/bash
+            # Returns 1 if only .rst and README files were modified
+            echo "Checking if only rst and READMEs were modified"
+            git show HEAD | grep -qo ^Merge:
+            if [ $? -eq 0 ]; then
+              git diff --name-only $(git show HEAD | grep ^Merge: | cut -d ':' -f2) | grep -v '\.rst\|README'
+              if [ $? -eq 1 ]; then
+                echo "Only docs were modified.  Skipping the rest of the job."
+                exit 1
+              fi
+            fi
+          on-evaluation-failure: dont-run
+          steps:
+            - shell:
+                !include-raw-escape:
+                  - ../../../scripts/build_utils.sh
+                  - ../../build/build
+
+    publishers:
+      - postbuildscript:
+          builders:
+            - role: SLAVE
+              build-on:
+                  - FAILURE
+                  - ABORTED
+              build-steps:
+                - shell:
+                    !include-raw-escape:
+                      - ../../../scripts/build_utils.sh
+                      - ../../build/teardown
+
+      - archive:
+          artifacts: 'logs/**'
+          allow-empty: true
+          latest-only: false
+
+    wrappers:
+      - inject-passwords:
+          global: true
+          mask-password-params: true
       - credentials-binding:
           - username-password-separated:
               credential-id: cephadm-ansible-quay-io
           - username-password-separated:
               credential-id: cephadm-ansible-quay-ceph-io
               username: QUAY_CEPH_IO_USERNAME
-              password: QUAY_CEPH_IO_PASSWORD
-
+              password: QUAY_CEPH_IO_PASSWORD
\ No newline at end of file