is it possible change app.yml to custom app.yml depends on my ENVIRONMENT?
matheusfrancisco opened this issue · comments
I don't know if this is possible but I'm trying to run appengineDeploy and sometimes build from app-env-stage.yml and sometimes app.yml. I did this on .kts file.
appengine {
stage.setArtifact("build/libs/${project.name}-${project.version}-all.jar")
val env = System.getenv("ENVIRONMENT") ?: "local"
deploy {
projectId = "GCLOUD_CONFIG"
version = "GCLOUD_CONFIG"
val path = when(env) {
"production" -> "$projectDir/src/main/appengine/prod"
"staging" -> "$projectDir/src/main/appengine/staging"
else -> "$projectDir/src/main/appengine/local"
}
setAppEngineDirectory(path)
}
}
but when I run appengineDeploy it tries to get from appengine/app.yml, not from the env I passed.
just don't know if is the best way but I figure it out I don´t know if I had to change only on stage.
deploy {
projectId = "GCLOUD_CONFIG"
version = "GCLOUD_CONFIG"
setAppEngineDirectory(
when(System.getenv("ENVIRONMENT") ?: "local") {
"production" -> "$projectDir/src/main/appengine/prod"
"staging" -> "$projectDir/src/main/appengine/staging"
else -> "$projectDir/src/main/appengine/local"
}
)
}
stage {
setAppEngineDirectory(
when(System.getenv("ENVIRONMENT") ?: "local") {
"production" -> "$projectDir/src/main/appengine/prod"
"staging" -> "$projectDir/src/main/appengine/staging"
else -> "$projectDir/src/main/appengine/local"
}
)
}
I understood just the stage worked
stage {
setAppEngineDirectory(
when(System.getenv("ENVIRONMENT") ?: "local") {
"production" -> "$projectDir/src/main/appengine/prod"
"staging" -> "$projectDir/src/main/appengine/staging"
else -> "$projectDir/src/main/appengine/local"
}
)
}