From 75ff21dac78fbae3f4b6fd1b063bf8d15328394c Mon Sep 17 00:00:00 2001 From: Albin Vass Date: Tue, 26 May 2020 10:38:22 +0200 Subject: [PATCH] ensure-bazel: replace ignore_errors with failed_when Also updated debug task to be more consistent with the rest of the repo. Change-Id: I26d97f903ea43e6cdbca5e707c85138f49a52322 --- roles/ensure-bazel/tasks/main.yaml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/roles/ensure-bazel/tasks/main.yaml b/roles/ensure-bazel/tasks/main.yaml index 28f0d9d69..3c5c52bcf 100644 --- a/roles/ensure-bazel/tasks/main.yaml +++ b/roles/ensure-bazel/tasks/main.yaml @@ -1,9 +1,12 @@ - name: Check version of bazel - shell: bazel --version | grep -Eo '([0-9]+\.)+[0-9]+' - ignore_errors: yes + shell: | + set -o pipefail + bazel --version | grep -Eo '([0-9]+\.)+[0-9]+' + failed_when: false register: installed_bazel_version -- debug: msg="Current installed Bazel version is {{ installed_bazel_version.stdout }}" +- debug: + msg: "Current installed Bazel version is {{ installed_bazel_version.stdout }}" - name: Download and install Bazel if needed include_tasks: install-bazel.yaml