Vlastimil Brecka
07/12/2026, 10:11 PM/gradlew :appA:decryptSecretsData -Pkey=$APPA_SECRETS_KEY
./gradlew :appB:decryptSecretsData -Pkey=$APPB_SECRETS_KEY
currently on CI I need to decrypt secrets per app (its a convention plugin applied to each app), and I'm doing it this way, and it works
however I'd like to have it be a single invocation
./gradlew :appA:decryptSecretsData -Pkey=$APPA_SECRETS_KEY :appB:decryptSecretsData -Pkey=$APPB_SECRETS_KEY
and this obviously doesnt work as the second -Pkey overwrites the first bla bla
can I somehow scope the -Pkey to a task?ephemient
07/13/2026, 2:04 AMPhilip W
07/13/2026, 4:14 AM-PkeyProjectAVlastimil Brecka
07/14/2026, 2:00 AMephemient
07/14/2026, 2:30 AMabstract class DecryptSecretsData : DefaultTask() {
@get:Option(option = "key", description = "decryption key")
abstract val key: Property<String>
}
tasks.register<DecryptSecretsData>("decryptSecretsData") {
key.convention(providers.gradleProperty("${path.trimStart(':').replace(':', '.')}.key"))
}
./gradlew :appA:decryptSecretsData --key=$APPA_SECRETS_KEY :appB:decryptSecretsData --key=$APPB_SECRETS_KEY
./gradlew -PappA.decryptSecretsData.key=$APPA_SECRETS_KEY -PappP.decryptSecretsData.key=$APPB_SECRETS_KEY :appA:decryptSecretsData :appB:decryptSecretsData
(and it's doable in the task init too, but that's not a good pattern)Vlastimil Brecka
07/18/2026, 8:53 PM--key=.... pattern for decryption key? bad idea?ephemient
07/18/2026, 10:43 PM-keyFile= so that the user can prevent it from being visible to other processes on the same hostVlastimil Brecka
07/22/2026, 10:24 PMVampire
07/22/2026, 11:07 PM--key, they see the secret.
If you give the secret with --keyfile, they see the file name, but you can protect the fine content from their eyes.
But for ad-hoc execution on a single user system --key might be more convenient.
So if you want to only have one, better go with --keyfile, or provide both.Vlastimil Brecka
07/23/2026, 2:21 AM