]> git.apps.os.sepia.ceph.com Git - ceph-build.git/commitdiff
ceph-ansible-prs: Don't run auto job if only docs were modified 1038/head
authorDavid Galloway <dgallowa@redhat.com>
Fri, 1 Jun 2018 21:13:42 +0000 (17:13 -0400)
committerDavid Galloway <dgallowa@redhat.com>
Thu, 7 Jun 2018 15:21:15 +0000 (11:21 -0400)
Signed-off-by: David Galloway <dgallowa@redhat.com>
ceph-ansible-prs/config/definitions/ceph-ansible-prs.yml

index b6a3aa1b3157a074f66357ba99a261268e9af6d3..76fd81975b681f6c8939ec6625cfcf76f3653c27 100644 (file)
             SCENARIO={scenario}
             RELEASE={release}
             ANSIBLE_VERSION={ansible_version}
-      - shell:
-          !include-raw-escape:
-            - ../../../scripts/build_utils.sh
-            - ../../build/build
+      - 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 diff --name-only $(git show HEAD | grep Merge | head -n 1 | 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
+          on-evaluation-failure: dont-run
+          steps:
+            - shell:
+                !include-raw-escape:
+                  - ../../../scripts/build_utils.sh
+                  - ../../build/build
 
     publishers:
       - postbuildscript: