Fork me on GitHub
#leiningen
<
2019-06-24
>
grumplet10:06:27

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?

grumplet10:06:11

Stuck here:

grumplet10:06:18

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 `

grumplet10:06:30

I have made and encrypted ~/.lein/credentials.gpg

grumplet10:06:55

Ah, ok. This got me further:

grumplet12:06:14

Still stuck.

grumplet12:06:21

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. `

grumplet12:06:36

but gpg --decrypt ~/.lein/credentials.clj.gpg works fine.

grumplet13:06:17

cracked deployment now. but lein still can’t find credentials. No idea why not.

mikerod14:06:40

@grumplet aren’t you supposed to have the file named ~/.lein/credentials.clj.gpg

mikerod14:06:47

not ~/.lein/credentials.gpg

grumplet15:06:11

I do have ~/.lein/credentials.clj.gpg

mikerod15:06:04

ok, you seemed like you didn’t with what you said before

mikerod15:06:55

also, you may want to try DEBUG=true lein deploy clojars

grumplet15:06:19

Thanks, I’ll try that.

grumplet15:06:31

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 `

grumplet15:06:06

~ is an alias for /Users/gmp26 on my system

grumplet15:06:33

Need to fix gpg: decryption failed: No secret key somehow

mikerod21:06:07

@grumplet yeah, looks like you found your issue

mikerod21:06:16

gpg maybe is not setup correctly if it isn’t able to findthat

mikerod16:06:59

@grumplet did you get it sorted out?

mikerod16:06:51

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
# 

# 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)

grumplet17:06:20

Thanks @U0LK1552A - That makes a lot of sense 🙂

grumplet17:06:30

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!

grumplet17:06:38

Thanks so much!

grumplet17:06:16

I guess the issue was GPG_AGENT_INFO since I'd set GPG_TTY manually.

👍 4
mikerod17:06:24

Nice. Glad it worked out then. Unfortunate it’s this sneaky how to do it right.

grumplet17:06:46

Yes - not so simple really.

mikerod17:06:25

I guess lein part is not bad. But have to figure out how to have gpg interoperate is the hard part.

grumplet17:06:19

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.

grumplet17:06:48

but thanks for your help anyway. Glad it's sorted.