Created
February 14, 2020 09:25
-
-
Save derms/0395a4f29879a7f3202ec18bf4779649 to your computer and use it in GitHub Desktop.
Skip ml-gradle mlUndeploy when production envirornment
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def isProd(taskName) { | |
def isProdEnv = "prod".equalsIgnoreCase(findProperty("environmentName")) | |
if (isProdEnv) { | |
println "Skipping ${taskName} as is prod envrionment" | |
} | |
return isProdEnv | |
} | |
mlUndeploy.onlyIf { !isProd("mlUndeploy") } | |
mlUndeploy.dependsOn.each { taskList -> | |
taskList.each { taskName -> | |
tasks.getByName(taskName).onlyIf { !isProd(taskName) } | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment