Skip to content

Commit ba3acc7

Browse files
committed
Tweak the env skip logic
1 parent f71b9c0 commit ba3acc7

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

vars/deployHelpers.groovy

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,17 @@ def getChangeInfo(parameters = [:]) {
5050
if (dir == "env") {
5151
// if an env yaml was changed, process all templates using that env file
5252
def envFile = l.split('/')[1]
53-
def envFileSplit = envFile.split('.')
54-
55-
// if we are only analyzing a specific env, ignore other changed env files
56-
if (envFileSplit && !envFileSplit[0].equals(envName)) continue
5753

5854
if (envFile.endsWith(".yaml") || envFile.endsWith(".yml")) {
59-
changeInfo['templates'].add(allTemplates)
60-
changeInfo['envFiles'].add(envFile)
61-
changeInfo['envFilesForDiff'].add(envFile)
55+
def envFileSplit = envFile.split('.')
56+
// if we are only analyzing a specific env, ignore other changed env files
57+
if (!envName || envFileSplit[0].equals(envName)) {
58+
changeInfo['templates'].add(allTemplates)
59+
changeInfo['envFiles'].add(envFile)
60+
changeInfo['envFilesForDiff'].add(envFile)
61+
} else {
62+
echo "Ignoring changes for ${envFile} -- only analyzing changes for env ${envName}"
63+
}
6264
}
6365
}
6466
else if (dir == "templates") {

0 commit comments

Comments
 (0)