Use batch gpg import if key is defined
Model designer passes gpg key to model generaion
but gpg tool couldn't import it without --batch parameter
Closes-bug: PROD-36081
Change-Id: I99c2246034df53aef99c66dd9327a2d634dde10b
diff --git a/generate-cookiecutter-products.groovy b/generate-cookiecutter-products.groovy
index 90af5c1..98107b8 100644
--- a/generate-cookiecutter-products.groovy
+++ b/generate-cookiecutter-products.groovy
@@ -205,7 +205,7 @@
sh "gpg --export-secret-key -a ${secretKeyID} > gpgkey.asc"
} else {
writeFile file: 'gpgkey.asc', text: context['secrets_encryption_private_key']
- sh "gpg --import gpgkey.asc"
+ sh "gpg --batch --import gpgkey.asc"
secretKeyID = sh(returnStdout: true, script: 'gpg --list-secret-keys --with-colons | grep -E "^sec" | awk -F: \'{print \$5}\'').trim()
}
context['secrets_encryption_key_id'] = secretKeyID