leiningen

N.B. The maintainers are on #leiningen on Libera chat IRC. Go there for direct support/bug reports.
grumplet 2019-06-24T10:29:27.058Z

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?

grumplet 2019-06-24T10:35:11.058800Z

Stuck here:

grumplet 2019-06-24T10:35:16.059Z

`

grumplet 2019-06-24T10:35:18.059200Z

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 `

grumplet 2019-06-24T10:36:30.060Z

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

grumplet 2019-06-24T10:36:46.060200Z

On MacOSX

grumplet 2019-06-24T10:38:55.060700Z

Ah, ok. This got me further:

grumplet 2019-06-24T10:39:02.060900Z

https://github.com/keybase/keybase-issues/issues/2798

grumplet 2019-06-24T12:53:14.061400Z

Still stuck.

grumplet 2019-06-24T12:53:16.061600Z

`

grumplet 2019-06-24T12:53:21.061800Z

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

grumplet 2019-06-24T12:56:36.063Z

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

grumplet 2019-06-24T13:09:17.063900Z

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

2019-06-24T14:33:40.064400Z

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

2019-06-24T14:33:47.064700Z

not ~/.lein/credentials.gpg

grumplet 2019-06-24T15:02:11.065200Z

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

2019-06-24T15:18:04.065600Z

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

2019-06-24T15:23:55.065900Z

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

grumplet 2019-06-24T15:36:19.066500Z

Thanks, I’ll try that.

grumplet 2019-06-24T15:36:26.066700Z

It says:

grumplet 2019-06-24T15:36:27.066900Z

`

grumplet 2019-06-24T15:36:31.067100Z

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 `

grumplet 2019-06-24T15:38:06.067500Z

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

grumplet 2019-06-24T15:39:33.068Z

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

2019-06-24T21:57:07.068200Z

@grumplet yeah, looks like you found your issue

2019-06-24T21:57:16.068500Z

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

2019-06-25T16:41:59.068600Z

@grumplet did you get it sorted out?

2019-06-25T16:44:51.068800Z

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 ] &amp;&amp; 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)

grumplet 2019-06-25T17:07:20.069Z

Thanks @mikerod - That makes a lot of sense 🙂

grumplet 2019-06-25T17:08:30.069200Z

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!

grumplet 2019-06-25T17:08:38.069400Z

Thanks so much!

grumplet 2019-06-25T17:10:16.069900Z

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

👍 1
2019-06-25T17:10:24.070300Z

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

grumplet 2019-06-25T17:10:46.070500Z

Yes - not so simple really.

2019-06-25T17:11:25.071500Z

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

grumplet 2019-06-25T17:13:19.071700Z

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.

grumplet 2019-06-25T17:13:48.071900Z

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