JetBrains / package-search-gradle-plugins

Gradle plugins for Docker, Terraform and Liquibase.
Apache License 2.0
32 stars 7 forks source link

executeApplyOnlyIf { true } is not respected #1

Closed wuub closed 2 years ago

wuub commented 2 years ago

in examples/project-b I changed the whole tf file to just

resource "random_integer" "priority" {
  min = 1
  max = 50001
}

and then tried gradle terraformApply

it always ends in

> Task :examples:terraform:project-b:terraformMainApply SKIPPED
Please specify a criteria with which execute terraform apply:
terraform {
    executeApplyOnlyIf { System.getenv("CAN_EXECUTE_TF_APPLY") == "true" }
}
Or disable the check:
terraform {
    executeApplyOnlyIf { true }
}
Cannot execute terraformMainApply. Please check your terraform extension in the script.

is it some sort of race condition? does this happen https://github.com/JetBrains/jetbrains-gradle-plugins/blob/master/plugins/src/main/kotlin/org/jetbrains/gradle/plugins/terraform/PluginUtils.kt#L334 before extension is fully initialised?

I don't know :)

lamba92 commented 2 years ago

It might be due to the main source set being initialized too early. I'll fix it in the next release

lamba92 commented 2 years ago

Should be fixed in 1.1.7