[Haskell-cafe] Picking up the CI buildnumber during build

Vanessa McHale vanessa.mchale at iohk.io
Fri May 4 12:51:04 UTC 2018


Hi Magnus,

I would use getEnv
<http://hackage.haskell.org/package/base-4.11.1.0/docs/System-Environment.html#v:getEnv>
or lookupEnv, along with Template Haskell and the runIO
<http://hackage.haskell.org/package/template-haskell-2.13.0.0/docs/Language-Haskell-TH-Syntax.html#v:runIO>
function. This would allow you to embed environment variables at compile
time.


On 05/04/2018 07:47 AM, Magnus Therning wrote:
> I'm looking for a way to pick up the CI buildnumber from the environment
> (e.g. $TRAVIS_BUILD_NUMBER) and use it as part of of the output of
> `my-tool --version`. I don't really know where to start looking, so I'm
> hoping someone on the list has already done something similar and can
> point me to a working example :)
>
> /M
>
> -- 
> Magnus Therning              OpenPGP: 0x927912051716CE39
> email: magnus at therning.org   jabber: magnus at therning.org
> twitter: magthe               http://therning.org/magnus
>
> I am always doing that which I cannot do, in order that I may learn
> how to do it.
>     — Pablo Picasso
>
>
> _______________________________________________
> Haskell-Cafe mailing list
> To (un)subscribe, modify options or view archives go to:
> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
> Only members subscribed via the mailman list are allowed to post.

-- 

*Vanessa McHale*
Functional Compiler Engineer | Chicago, IL
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20180504/b11a0c8e/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 455 bytes
Desc: OpenPGP digital signature
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20180504/b11a0c8e/attachment.sig>


More information about the Haskell-Cafe mailing list