From 9c79253e49a22387ec7dfbabe04effe0d5f2c697 Mon Sep 17 00:00:00 2001 From: David Galloway Date: Fri, 1 Jun 2018 17:13:42 -0400 Subject: [PATCH] ceph-ansible-prs: Don't run auto job if only docs were modified Signed-off-by: David Galloway --- .../config/definitions/ceph-ansible-prs.yml | 21 +++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/ceph-ansible-prs/config/definitions/ceph-ansible-prs.yml b/ceph-ansible-prs/config/definitions/ceph-ansible-prs.yml index b6a3aa1b..76fd8197 100644 --- a/ceph-ansible-prs/config/definitions/ceph-ansible-prs.yml +++ b/ceph-ansible-prs/config/definitions/ceph-ansible-prs.yml @@ -234,10 +234,23 @@ 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: -- 2.47.3