title: Automated GnuPG key generation during maven deployment does not export secret key
body: <p>I have a oss pom based java project hosted in gitlab - <a href="https://gitlab.com/dizitart/jbus" rel="nofollow noreferrer">JBus</a>. I want to setup automated deployment to central maven repository via gitlab-ci-runner.</p>
  
  <p>One problem I am currently facing is automated gpg key generation in gitlab ci server. I followed the below steps</p>
  
  <pre><code>$cat &gt;foo &lt;&lt;EOF
       %echo Generating a basic OpenPGP key
       Key-Type: DSA
       Key-Length: 1024
       Subkey-Type: ELG-E
       Subkey-Length: 1024
       Name-Real: Anindya Chatterjee
       Name-Comment: with stupid passphrase
       Name-Email: anidotnet- at -gmail.com
       Expire-Date: 0
       Passphrase: abc
       %pubring foo.pub
       %secring foo.sec
       # Do a commit here, so that we can later print "done" :-)
       %commit
       %echo done
  EOF
  
  $gpg2 --verbose --batch --gen-key foo
  </code></pre>
  
  <p>But above thing does not generate any <code>foo.sec</code> file with secret key ring.</p>