Fork me on GitHub
#leiningen
<
2020-11-05
>
dangercoder09:11:37

Can the change command add a non-existing key?

Franklin11:11:29

I wonder if leiningen should be installed in a production server and if it's ok then to run lein repl on the server? Thoughts anyone?

Franklin11:11:28

asking this because it would be nice if you could reproduce issues you are having in production by running code in the same environment it's deployed in (on the same box) while trying to debug....

Franklin11:11:45

just like you can do in a django shell or something similar

Franklin11:11:34

I noticed in the leiningen documentation that they recommend that you don't use leiningen in production and use an uberjar instead... but still...

Lennart Buit12:11:50

You can also embed nrepl in your app

3
andy.fingerhut14:11:09

I think a lot of developers prefer to create and deploy JAR files to their production environment, rather than run Leiningen there. For one, running Leiningen in production deployment machines opens you up to the possibility of resolving dependencies differently, and/or failing to retrieve those dependencies over the network.

Franklin14:11:37

I'll investigate using nrepl...

andy.fingerhut15:11:36

There are also socket REPLs that can be enabled, built into Clojure with no extra dependency, if you prefer, which can be used during development and in production (as can nrepl, if you wish). The choice between those is, I believe, primarily driven by whether the dev environment that you want to connect to the JVM process is using nrepl

Louis Kottmann13:11:19

you should start a NRepl in your production on a secured port (not forwarded publicly)

Louis Kottmann13:11:27

and then connect to it locally

Louis Kottmann13:11:38

with lein repl :connect ...

dangercoder14:11:19

Hi, I have a wierd error with lein update-in. This does not work: lein update-in : assoc :local-repo "/workspace/lein-repo" -- test This works lein update-in : assoc :local-repo "123" -- test

dangercoder14:11:27

not sure why "/workspace/lein-repo" would not work

mikerod14:11:20

@jarvinenemil what is not working. And the second command doesn’t do anything really on its own . So what “works” about it ?

dangercoder14:11:47

im expecing the config map to be updated but 1 throws exception

dangercoder14:11:06

getting error in the lisp interpreter when using the workspace-string

mikerod14:11:06

What sort of exception

Louis Kottmann14:11:03

why is there a space between : and assoc?

dangercoder14:11:14

I use : so I am at the top-level

dangercoder14:11:20

since there is only update-in

mikerod14:11:47

@jarvinenemil maybe just a bash escaping issue

mikerod14:11:55

Put single quotes around your path string

mikerod14:11:02

Perhaps it’s being interpolated.

mikerod14:11:34

Although weird to me

mikerod14:11:41

:local-repo is assumed relative path

mikerod14:11:46

Relative to the project root.

mikerod14:11:09

So you’d path may just not be a supported type here.

dangercoder14:11:31

ah, I am trying to get my ci/cd pipeline to cache dependencies

dangercoder14:11:59

when using leiningen, so I figured that :local-repo was the way to go

mikerod14:11:39

Yeah. I’ve done similar before

mikerod14:11:47

But I had some other workarounds I think

mikerod14:11:59

You maybe could try some sort of symlink

mikerod14:11:04

I never tried that before

dangercoder15:11:09

I have a maven pipeline that works so I figured it should play almost the same 😉

dangercoder18:11:41

Is anyone building clojure code in docker containers? I am running the official clojure:lein image and it does not recognize with-profile commands etc. test and uberjar works fine

dangercoder18:11:57

If you are, please tell me which image ur using

noisesmith20:11:01

@jarvinenemil so you're saying lein with-profile +foo ... isn't working? what did you try and what's the symptom?

dangercoder09:11:32

I tried to execute that command inside the docker-container and it says 'with-profile +ci-cd test' is not a task. See 'lein help'.

dangercoder09:11:30

I am using clojure:openjdk-11-lein from DockerHub

noisesmith15:11:16

it looks to me like it wanted "with-profile" "+ci-cd" "test" in the Dockerfile, and got "with-profile +ci-cd test" instead

noisesmith15:11:23

(ins)[email protected]:~/clojure-experiments$ lein with-profile +foo repl
Warning: profile :foo not found.
Warning: profile :foo not found.
nREPL server started on port 46677 on host 127.0.0.1 - 
REPL-y 0.4.4, nREPL 0.6.0
Clojure 1.10.0
OpenJDK 64-Bit Server VM 11.0.7+10-post-Ubuntu-2ubuntu219.10
    Docs: (doc function-name-here)
          (find-doc "part-of-name-here")
  Source: (source function-name-here)
 Javadoc: (javadoc java-object-or-class-here)
    Exit: Control+D or (exit) or (quit)
 Results: Stored in vars *1, *2, *3, an exception in *e

user=> Bye for now!
(ins)[email protected]:~/clojure-experiments$ lein 'with-profile +foo repl'
'with-profile +foo repl' is not a task. See 'lein help'.

dangercoder18:11:52

im gonna try to split it up thanks

dangercoder18:11:01

because when I only have one command, such as "test" it works just fine

noisesmith20:11:13

right, that's what I'd expect from shell quoting

dangercoder21:11:22

thanks @U051SS2EU I just verified that this solved my issue. I am very grateful that you took the time to help me out 🙂.