Clojurians
#leiningen
<
2017-02-22
>

This page is not created by, affiliated with, or supported by Slack Technologies, Inc.

jumar14:02:41

Is there a way to read value from profiles.clj in project.clj? I'd like to configure migratus in my-app/project.clj:

:migratus {:store :database
             :migration-dir "migrations"
             :db {:subprotocol "postgresql"
                  :user ???
                  :password ???
                  :dbname ???
                  :host ???}}
I have the db config stored in my-app/profiles.clj:
{:dev  {:env {:db-user "xxx"
                       :db-password "xxx"
                       :db-host "localhost"
                       :db-name "xxx"}}}

jumar14:02:45

in project.clj generated by luminus template there's something like this:

:migratus {:store :database :db ~(get (System/getenv) "DATABASE_URL")}
But that doesn't seem to work in my project (unless I really set the environment variables via "export")

jumar14:02:53

I guess it works in project generated by luminus because of this: https://github.com/yogthos/migratus-lein/blob/master/src/leiningen/migratus.clj#L41

jumar15:02:00

@weavejester @yogthos any ideas?

jumar15:02:25

ah sorry, probaly just @yogthos

yogthos16:02:21

you’d pretty much have to do what the luminus template is doing using the migratus-lein plugin

jumar17:02:06

too bad - nevertheless, thanks for the response

yogthos20:02:13

no problem

hlship23:02:58

I’m having some truly bizarre behavior with lein uberjar.

hlship23:02:18

It claims to be packaging files from a dependency:

Including protobuf-java-2.6.1.jar
  Dropping com/google/protobuf/AbstractMessage$Builder.class
  Dropping com/google/protobuf/AbstractMessage.class
  Dropping com/google/protobuf/AbstractMessageLite$Builder$LimitedInputStream.class
but it is (in DEBUG mode) emitting spurious (I think) warnings about dropping files. And the files that end up in the standalone Uber jar don’t seem to be right.

hlship23:02:43

In the AOT’ed JAR file:

-rw-rw-rw-      1932  30-Oct-2013  12:54:18  com/google/protobuf/UnmodifiableLazyStringList.class
In protobuf-java-2.6.1.jar:
-rw-rw-rw-      3830  22-Oct-2014  16:35:54  com/google/protobuf/UnmodifiableLazyStringList.class

hlship23:02:15

This is with 2.7.1. There is only one version of protobuf-java (2.6.1) from lein deps :tree and no warnings about it.

hlship23:02:48

All I can think of is that some other JAR is also packaging protobuf’s classes, an old version of them.

hlship23:02:32

So far, I haven’t found such a jar.

hlship23:02:16

org/flatland/protobuf/0.8.1 seems to be the culrprit.