librelist archives

« back to archive

Fwd: System env vars in project.clj

Fwd: System env vars in project.clj

From:
Nick Zalabak
Date:
2014-02-08 @ 18:54
I am attempting to use environment variables in the username and password
area of the :mirrors section in my project.clj. What am I doing wrong? I've
pasted a gist with what I've tried thus far. Wrapping the defproject macro
with a let sort of sucks, I am hoping that I can use the :env/my_var syntax.

https://gist.github.com/techwhizbang/8887976

Re: [leiningen] System env vars in project.clj

From:
Sean Corfield
Date:
2014-02-08 @ 23:47
could not decode message

Re: [leiningen] System env vars in project.clj

From:
Nick Zalabak
Date:
2014-02-09 @ 00:10
Thanks Sean, that definitely works.

Though it still leaves me wondering about how the :env syntax documented
here really works
https://github.com/technomancy/leiningen/blob/master/sample.project.clj#L102


On Sat, Feb 8, 2014 at 3:47 PM, Sean Corfield <sean@corfield.org> wrote:

> You're close - just use ~(System/getenv "artifactory_username") as the
> :username value inside defproject - no need for a let or anything.
>
> On Feb 8, 2014, at 10:54 AM, Nick Zalabak <techwhizbang@gmail.com> wrote:
>
>
> I am attempting to use environment variables in the username and password
> area of the :mirrors section in my project.clj. What am I doing wrong? I've
> pasted a gist with what I've tried thus far. Wrapping the defproject macro
> with a let sort of sucks, I am hoping that I can use the :env/my_var syntax.
>
> https://gist.github.com/techwhizbang/8887976
>
>
>
>

Re: [leiningen] System env vars in project.clj

From:
Sean Corfield
Date:
2014-02-09 @ 00:36
could not decode message

Re: [leiningen] System env vars in project.clj

From:
Sean Corfield
Date:
2014-02-09 @ 00:34
could not decode message

Re: [leiningen] System env vars in project.clj

From:
Jean Niklas L'orange
Date:
2014-02-09 @ 00:08
I presume this is a documented feature which actually isn't implemented,
see

https://github.com/technomancy/leiningen/blob/master/doc/DEPLOY.md#credentials-in-the-environment

Should it be implemented, or should we change the documentation to use the
solution Sean just described?


On 9 February 2014 00:47, Sean Corfield <sean@corfield.org> wrote:

> You're close - just use ~(System/getenv "artifactory_username") as the
> :username value inside defproject - no need for a let or anything.
>
> On Feb 8, 2014, at 10:54 AM, Nick Zalabak <techwhizbang@gmail.com> wrote:
>
>
> I am attempting to use environment variables in the username and password
> area of the :mirrors section in my project.clj. What am I doing wrong? I've
> pasted a gist with what I've tried thus far. Wrapping the defproject macro
> with a let sort of sucks, I am hoping that I can use the :env/my_var syntax.
>
> https://gist.github.com/techwhizbang/8887976
>
>
>
>


-- 
Regards,
Jean Niklas L'orange

Re: [leiningen] System env vars in project.clj

From:
Nick Zalabak
Date:
2014-02-09 @ 00:16
Thanks Jean, yes I knew I saw this feature documented somewhere but I
couldn't remember exactly where. ~(System/getenv "your_var") is equally
effective and probably easier to remember.


On Sat, Feb 8, 2014 at 4:08 PM, Jean Niklas L'orange
<jeannikl@hypirion.com>wrote:

> I presume this is a documented feature which actually isn't implemented,
> see
> 
https://github.com/technomancy/leiningen/blob/master/doc/DEPLOY.md#credentials-in-the-environment
>
> Should it be implemented, or should we change the documentation to use the
> solution Sean just described?
>
>
> On 9 February 2014 00:47, Sean Corfield <sean@corfield.org> wrote:
>
>> You're close - just use ~(System/getenv "artifactory_username") as the
>> :username value inside defproject - no need for a let or anything.
>>
>> On Feb 8, 2014, at 10:54 AM, Nick Zalabak <techwhizbang@gmail.com> wrote:
>>
>>
>> I am attempting to use environment variables in the username and password
>> area of the :mirrors section in my project.clj. What am I doing wrong? I've
>> pasted a gist with what I've tried thus far. Wrapping the defproject macro
>> with a let sort of sucks, I am hoping that I can use the :env/my_var syntax.
>>
>> https://gist.github.com/techwhizbang/8887976
>>
>>
>>
>>
>
>
> --
> Regards,
> Jean Niklas L'orange
>

Re: [leiningen] System env vars in project.clj

From:
Chas Emerick
Date:
2014-02-09 @ 13:37
This is incorrect.  I use the :env/* approach right now in a couple of 
projects, and I helped implement support for it, :gpg, and misc related 
bits around a year ago (see 

https://github.com/technomancy/leiningen/blob/master/leiningen-core/src/leiningen/core/user.clj).

My particular use case involves using s3p repositories, but the 
resulting configuration is not so different from Nick's pasted examples:

(defproject your-clojure-app "1.0.0-SNAPSHOT"
   :dependencies [[com.cemerick/some-private-artifact "0.0.1"]]
   :plugins [[s3-wagon-private "1.1.2"]]
   :repositories {"whatever" {:url "s3p://my-s3-bucket/releases"
                              :username :env/FOO
                              :passphrase :env/BAR}})

I'm currently using Leiningen 2.3.2; perhaps there's been a regression 
since then, but I don't want to jostle my environment to find out.

Hope this helps?

- Chas

On 02/08/2014 07:08 PM, Jean Niklas L'orange wrote:
> I presume this is a documented feature which actually isn't 
> implemented, see 
> 
https://github.com/technomancy/leiningen/blob/master/doc/DEPLOY.md#credentials-in-the-environment

>
>
> Should it be implemented, or should we change the documentation to use 
> the solution Sean just described?
>
>
> On 9 February 2014 00:47, Sean Corfield <sean@corfield.org 
> <mailto:sean@corfield.org>> wrote:
>
>     You're close - just use ~(System/getenv "artifactory_username") as
>     the :username value inside defproject - no need for a let or
>     anything.
>
>     On Feb 8, 2014, at 10:54 AM, Nick Zalabak <techwhizbang@gmail.com
>     <mailto:techwhizbang@gmail.com>> wrote:
>
>>
>>     I am attempting to use environment variables in the username and
>>     password area of the :mirrors section in my project.clj. What am
>>     I doing wrong? I've pasted a gist with what I've tried thus far.
>>     Wrapping the defproject macro with a let sort of sucks, I am
>>     hoping that I can use the :env/my_var syntax.
>>
>>     https://gist.github.com/techwhizbang/8887976
>>
>
>
>
>
>
> -- 
> Regards,
> Jean Niklas L'orange