Fork me on GitHub
#clojure-uk
<
2019-09-20
>
dharrigan07:09:17

Nice day in Laaaawwwdan

dharrigan07:09:14

man - intellij eap is borked atm for imports

Ben Hammond08:09:29

isn't it borked for deps.edn too

Ben Hammond08:09:02

I'm still holding out on 2019.1

dharrigan08:09:47

direnv what a great tool!

dharrigan08:09:04

handy to export environment variables on a per-directory basis 🙂

dharrigan09:09:24

Well, say you have scripts in your repo that do things, like setup services, or invoke remote APIs to download some data

dharrigan09:09:36

you can generalise the scripts, but putting the endpoints etc., as environment variables

dharrigan09:09:56

then using direnv, each developer can customise the variarlable as required.

dominicm09:09:03

you use env variables to parameterize your scripts?

dominicm09:09:10

isn't that what args are for?

dharrigan09:09:33

it's just another way of doing it

dharrigan09:09:37

here's an exmaple

dharrigan09:09:51

#!/bin/bash

# Please use direnv to store the ES variable

ES="${ES:-}"

cat investigation-mapping.json | http PUT $ES/investigation_a

dominicm09:09:10

admittedly, for the use-case you're describing. I'd probably just do this in the scripts: [ -f "../.env" ] && . ../.env No program required

dharrigan09:09:13

that's super simple to do, rather than mess around with arguments, positions et.c..

dharrigan09:09:32

in my direnv, I have this

dharrigan09:09:17

and once I cd into that directory, direnv will load the .direnv and export the environment for me.

dominicm09:09:24

the other side of this, is that I don't find that developers much need to parameterize these things much. Everyone can agree on where elasticsearch will be.

dharrigan09:09:45

I have a local elasticsearch and a remote elasticsearch running on http://elastic.co

dharrigan09:09:58

I try out things locally first, esp with migrations from previous versions to newever versions

dharrigan09:09:10

it takes a while for our ops team to migrate the elasticsearch in da cloud!

dharrigan09:09:28

so, having direnv gives me the ability to choose, but not just me, others in the team too

dharrigan09:09:51

it has proven to be a handy tool 🙂

dominicm09:09:39

you've also got ./foo -e though right

otfrom09:09:32

anyone here climatestriking today? I've done our website, but as I own the company I have to admit I don't know what the form is

folcon15:09:05

ok, that is brilliant =)…

dharrigan09:09:31

many ways of skinning the cat

danielneal10:09:40

is skinning a cat like skinning winamp or skinning rabbits

dharrigan10:09:11

in the olden days, maybe

practicalli-john14:09:56

I am not letting you near my cats... just in case

😂 4
dharrigan09:09:49

nice thing is, I don't have to remember to do it

dharrigan09:09:03

and direnv doesn't imped others from doing it their way

dharrigan09:09:26

but once I set my environment variable in direnv, I can forget about having to remembre to pass in stuff to the script, for my local development

dharrigan15:09:53

I see systemd is now a step further to becoming its own OS: https://www.phoronix.com/scan.php?page=news_item&amp;px=systemd-homed

dominicm18:09:30

I'm glad I ripped that shit out

flefik18:09:25

i got very upset when ubuntu migrated from upstart to systemd

mccraigmccraig19:09:22

@cfeckardt why ? (i haven't exactly been paying a lot of attention, but i haven't noticed much difference, other than that the systemd logging facilities seem to work much better with k8s+fluent-bit than i ever got the upstart or whatever logging facilities to work with dc/os)