From a24ca937cd9763f0ed85059947b68d16ef4fd7a4 Mon Sep 17 00:00:00 2001 From: Amir Zarrinkafsh Date: Sun, 15 Mar 2020 21:07:23 +1100 Subject: [PATCH] [Buildkite] Fix docs bypass for tagged releases (#709) --- .buildkite/deployment.sh | 10 ++++++---- .buildkite/pipeline.sh | 14 ++++++++------ 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/.buildkite/deployment.sh b/.buildkite/deployment.sh index e07073dc..027688f5 100755 --- a/.buildkite/deployment.sh +++ b/.buildkite/deployment.sh @@ -1,10 +1,12 @@ #!/bin/bash set -u -if [[ $BUILDKITE_BRANCH == "master" ]]; then - CI_DOCS_BYPASS=$(git diff --name-only HEAD~1 | sed -rn '/^docs\/.*/!{q1}' && echo true || echo false) -else - CI_DOCS_BYPASS=$(git diff --name-only `git merge-base --fork-point origin/master` | sed -rn '/^docs\/.*/!{q1}' && echo true || echo false) +if [[ $BUILDKITE_TAG == "" ]]; then + if [[ $BUILDKITE_BRANCH == "master" ]]; then + CI_DOCS_BYPASS=$(git diff --name-only HEAD~1 | sed -rn '/^docs\/.*/!{q1}' && echo true || echo false) + else + CI_DOCS_BYPASS=$(git diff --name-only `git merge-base --fork-point origin/master` | sed -rn '/^docs\/.*/!{q1}' && echo true || echo false) + fi fi cat << EOF diff --git a/.buildkite/pipeline.sh b/.buildkite/pipeline.sh index f57848db..b2511980 100755 --- a/.buildkite/pipeline.sh +++ b/.buildkite/pipeline.sh @@ -1,14 +1,16 @@ #!/bin/bash set -u -if [[ $BUILDKITE_BRANCH == "master" ]]; then - CI_DOCS_BYPASS=$(git diff --name-only HEAD~1 | sed -rn '/^docs\/.*/!{q1}' && echo true || echo false) -else - CI_DOCS_BYPASS=$(git diff --name-only `git merge-base --fork-point origin/master` | sed -rn '/^docs\/.*/!{q1}' && echo true || echo false) -fi +if [[ $BUILDKITE_TAG == "" ]]; then + if [[ $BUILDKITE_BRANCH == "master" ]]; then + CI_DOCS_BYPASS=$(git diff --name-only HEAD~1 | sed -rn '/^docs\/.*/!{q1}' && echo true || echo false) + else + CI_DOCS_BYPASS=$(git diff --name-only `git merge-base --fork-point origin/master` | sed -rn '/^docs\/.*/!{q1}' && echo true || echo false) + fi -if [[ $CI_DOCS_BYPASS == "true" ]]; then + if [[ $CI_DOCS_BYPASS == "true" ]]; then cat .buildkite/annotations/documentation | buildkite-agent annotate --style "info" --context "ctx-info" + fi fi cat << EOF