From ba3acc725dd1f416b5f5bb5f8f985872356fb727 Mon Sep 17 00:00:00 2001 From: Brandon Squizzato Date: Thu, 26 Sep 2019 11:30:20 -0400 Subject: [PATCH] Tweak the env skip logic --- vars/deployHelpers.groovy | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/vars/deployHelpers.groovy b/vars/deployHelpers.groovy index 599c7607..b297b8de 100644 --- a/vars/deployHelpers.groovy +++ b/vars/deployHelpers.groovy @@ -50,15 +50,17 @@ def getChangeInfo(parameters = [:]) { if (dir == "env") { // if an env yaml was changed, process all templates using that env file def envFile = l.split('/')[1] - def envFileSplit = envFile.split('.') - - // if we are only analyzing a specific env, ignore other changed env files - if (envFileSplit && !envFileSplit[0].equals(envName)) continue if (envFile.endsWith(".yaml") || envFile.endsWith(".yml")) { - changeInfo['templates'].add(allTemplates) - changeInfo['envFiles'].add(envFile) - changeInfo['envFilesForDiff'].add(envFile) + def envFileSplit = envFile.split('.') + // if we are only analyzing a specific env, ignore other changed env files + if (!envName || envFileSplit[0].equals(envName)) { + changeInfo['templates'].add(allTemplates) + changeInfo['envFiles'].add(envFile) + changeInfo['envFilesForDiff'].add(envFile) + } else { + echo "Ignoring changes for ${envFile} -- only analyzing changes for env ${envName}" + } } } else if (dir == "templates") {