I'm trying to create a new task in build.gradle for running "check" with a custom environment called "integration".
I've tried several things and I've been able to run the check task from my custom task but I can't find the way to set the environment in int.
This is the task that I have right now in build.gradle. The comments are for things that I've tried but all fail because the property doesn't exist. I've also tried setting the task as type:GrailsTask, but with no luck
task integrationCheck(){
dependsOn "check"
//env = "integration"
//grailsEnv = "integration"
//tasks.check.env = "integration"
//check.env = "integration"
//project.property("grailsEnv")
}
Edit: per @vinay-prajapati suggestion
Have tried with this:
task integrationCheck << {
systemProperty 'spring.profiles.active', 'integration'
}
And it gives this error:
Execution failed for task ':integrationCheck'.
> Could not find method systemProperty() for arguments [spring.profiles.active, integration] on root project 'my-project'