From bd0259e7bb5f045a1ba7958d79039848d062aad1 Mon Sep 17 00:00:00 2001 From: Alexandru Avadanii Date: Tue, 26 Sep 2017 01:16:54 +0200 Subject: patch.sh: Exit on patch apply failure Patches that fail to apply are silently skipped. Since retrying is not possible, deploy moves on, making the problem hard to observe. Change-Id: I3fe01cef6b245de53767a660b9b4fdfae0d5d0ff Signed-off-by: Alexandru Avadanii --- mcp/patches/patch.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'mcp/patches') diff --git a/mcp/patches/patch.sh b/mcp/patches/patch.sh index 6cd65fd10..b56ebb815 100755 --- a/mcp/patches/patch.sh +++ b/mcp/patches/patch.sh @@ -1,8 +1,9 @@ -#!/bin/bash +#!/bin/bash -ex if [ -r "$1" ]; then while IFS=': ' read -r p_dest p_file; do - [[ "${p_dest}" =~ $2 ]] && \ + if [[ "${p_dest}" =~ $2 ]]; then patch -fd "${p_dest}" -p1 < "/root/fuel/mcp/patches/${p_file}" + fi done < "$1" fi -- cgit 1.2.3-korg