Fork me on GitHub
#luminus
<
2017-07-06
>
hackeryarn00:07:44

I think I settled on using peridot and logging in before every request that requires auth.

llsouder16:07:24

@yogthos in selmer is there a way to do {% if forloop.counter = 0 or forloop.counter = 1 %}

llsouder16:07:42

looking at the code I would say no. Maybe I can call a clojure method? if says evaluates a condition so could that be clojure call?

yogthos18:07:10

@llsouder you could do it using a filter (selmer.filters/add-filter! :matching-counter #(some #{%} [0 1])) and then {% if forloop.counter|matching-counter %}hello{% endif %}

llsouder18:07:37

thanks. Where does the (selmer.filters/add-filter! :matching-counter #(some #{%} [0 1])) go? in the template or the clj file?

llsouder18:07:17

that looks like clojure but the #{%} looks like template stuff.

yogthos19:07:45

that would go in the clj file

yogthos19:07:02

the #{%} is just set notation

janvanryswyck19:07:53

I’m trying to figure out how to deploy a Luminus web app to Linode. I’ve read the excellent docs (http://www.luminusweb.net/docs/deployment.md) I was wondering how I could automate deployments as much as possible. My first thought was setting up a docker container and deploying it with dokku (git push a la Heroku). I would love to hear some other thoughts as well. Thanks in advance!

yogthos19:07:37

docker definitely works, another option to look at is vagrant

yogthos19:07:53

if you’re only running a single app on the node, then it probably makes more sense

janvanryswyck19:07:01

The idea is to add at least one more separate web app for another subdomain

yogthos19:07:54

if you have multiple apps, then dockerizing is probably the way to go

yogthos19:07:35

but depends on the complexity of the apps as well, if you need external dependencies like queues, databases, etc, then I find docker is nice

yogthos19:07:00

if you just have the apps, then you can probably front with nginx easily enough

yogthos19:07:22

jars are already pretty self contained

janvanryswyck19:07:42

I currently have a single DB for both apps and some reliance on the file system. Queues might come in the picture later on.

yogthos19:07:26

I guess it depends on whether you need isolation or not

yogthos19:07:35

if you’re sharing resources, I think vagrant is better

yogthos19:07:56

docker is nice specifically for cases where each app has its own independent stack

janvanryswyck20:07:54

I’m somewhat familiar with Docker, but Vagrant looks nice as well

yogthos20:07:28

ansible is another nice tool for provisioning https://www.ansible.com/

janvanryswyck20:07:33

A simple deploy script with some ssh commands might still be a viable option as well once nginx is setup

yogthos20:07:10

yeah if your setup is simple, no need to overcomplicate 🙂

janvanryswyck20:07:14

As you said, jars are nice

yogthos20:07:47

the thing that’s nice with vagrant is that it lets you script the whole system setup, so you can easily rebuild it later

janvanryswyck20:07:15

Looks very interesting for local dev environments

yogthos20:07:37

nowadays I like to treat system config as code, put it in a script, check it in the repo 🙂

yogthos20:07:07

otherwise you always end up with situations where you forget how you configured it originally and start scratching your head 🙂

janvanryswyck20:07:44

That’s the good old days 😉

janvanryswyck20:07:33

Thanks for your insights. 🙂

yogthos20:07:27

no prob 🙂