Having a senior moment setting up to ‘lein deploy clojars’. The docs say it’s simple and then talk about all the non-simple cases instead. Is there a simple doc with an example?
Stuck here:
`
Could not decrypt credentials from /Users/gmp26/.lein/credentials.clj.gpg
nil
See lein help gpg
for how to install gpg.
No credentials found for clojars
See lein help deploying
for how to configure credentials to avoid prompts.
Username: gmp26
Password:
Created /Users/gmp26/clojure/winton-utils/target/winton-utils-0.2.1.jar
Wrote /Users/gmp26/clojure/winton-utils/pom.xml
Need to sign 2 files with GPG
[1/2] Signing /Users/gmp26/clojure/winton-utils/target/winton-utils-0.2.1.jar with GPG
gpg: signing failed: Inappropriate ioctl for device
gpg: signing failed: Inappropriate ioctl for device
`
I have made and encrypted ~/.lein/credentials.gpg
On MacOSX
Ah, ok. This got me further:
Still stuck.
`
lapc-br1-425:winton-utils gmp26$ lein deploy clojars
No credentials found for clojars
See lein help deploying
for how to configure credentials to avoid prompts.
`
but gpg --decrypt ~/.lein/credentials.clj.gpg
works fine.
cracked deployment now. but lein still can’t find credentials. No idea why not.
@grumplet aren’t you supposed to have the file named ~/.lein/credentials.clj.gpg
not ~/.lein/credentials.gpg
I do have ~/.lein/credentials.clj.gpg
ok, you seemed like you didn’t with what you said before
also, you may want to try DEBUG=true lein deploy clojars
Thanks, I’ll try that.
It says:
`
DEBUG=true lein deploy clojars
Leiningen’s classpath: /Users/gmp26/.lein/self-installs/leiningen-2.7.1-standalone.jar
Applying task deploy to [clojars]
gpg: decryption failed: No secret key
Could not decrypt credentials from /Users/gmp26/.lein/credentials.clj.gpg
`
~ is an alias for /Users/gmp26 on my system
Need to fix gpg: decryption failed: No secret key
somehow
@grumplet yeah, looks like you found your issue
gpg
maybe is not setup correctly if it isn’t able to findthat
@grumplet did you get it sorted out?
If it helps at all: Just to note, I do have this in my ~/.zshrc
(I think it’s portable to other shells though)
# For GPG with S3 and Maven
# gnupg
# <https://github.com/pstadler/keybase-gpg-github/issues/11>
# start gpg-agent if not already running
[ -f ~/.gpg-agent-info ] && source ~/.gpg-agent-info
if [ -S "${GPG_AGENT_INFO%%:*}" ]; then
export GPG_AGENT_INFO
else
eval $( gpg-agent --daemon --enable-ssh-support )
fi
export GPG_AGENT_INFO
export GPG_TTY=$(tty)
Thanks @mikerod - That makes a lot of sense 🙂
And yes - I already had a gpg-agent running so at first your script barfed. But when I killed it and restarted with your script - success!
Thanks so much!
I guess the issue was GPG_AGENT_INFO
since I'd set GPG_TTY
manually.
Nice. Glad it worked out then. Unfortunate it’s this sneaky how to do it right.
Yes - not so simple really.
I guess lein part is not bad. But have to figure out how to have gpg interoperate is the hard part.
lein part could be better too. The docs are there but they are in many places and they keep cross referencing. I found it tricky to follow.
but thanks for your help anyway. Glad it's sorted.