These are chat archives for jescalan/roots

12th
Jan 2017
Carl Morlock
@gin93r
Jan 12 2017 13:50
How do you guys handle CI (like Bamboo) with Roots? Currently, and I think it's the default, the build directory is ignored in git. So this leaves me wondering what the best approach would be for automatic deployment. I'm not so sure I can globally install roots as a build task and run the compile. Well, I probably could... but I think installing roots globally like that each time would have longer build times.
Tom Kraak
@tkraak
Jan 12 2017 14:03
@gin93r … I would say the majority of us in the roots / spike community deploy to netlify, which is awesome
are you familiar with netlify or services like it?
Carl Morlock
@gin93r
Jan 12 2017 14:04
@tkraak Thanks. I believe when I started using roots I read that, however, we're use atlassian products.
Not Netlify specifically no.
Tom Kraak
@tkraak
Jan 12 2017 14:05
I mean just the way such services work in general
Carl Morlock
@gin93r
Jan 12 2017 14:06
Maybe? I know that's an odd answer. Maybe I should go with "no".
We use Bamboo for our CI here so I'm familiar with setting up builds and deployment plans. I'm not sure if services like Netflify are the same.
Tom Kraak
@tkraak
Jan 12 2017 14:08
netlify only does hosting though
Carl Morlock
@gin93r
Jan 12 2017 14:10
lol. I think in this case both but more or less CD.
Tom Kraak
@tkraak
Jan 12 2017 14:10
yeah, I just realized that
Carl Morlock
@gin93r
Jan 12 2017 14:11
I mean - worst case scenario, I don't ignore the "public" directory that roots compiles to.
Tom Kraak
@tkraak
Jan 12 2017 14:11
netlify pulls from your repo and builds the site, very similar to what happens locally
Carl Morlock
@gin93r
Jan 12 2017 14:11
So does netlify then install roots each time it runs the plan then?
Tom Kraak
@tkraak
Jan 12 2017 14:11
it does
spins up a docker container I believe, but don’t quote me on that :)
Carl Morlock
@gin93r
Jan 12 2017 14:12
Ok, I can probably do the same thing then. I can run npm and node tasks. Just would hate to have to install roots each time I run a build.
It's a long install...
Tom Kraak
@tkraak
Jan 12 2017 14:13
you got lots of stuff going on?
Carl Morlock
@gin93r
Jan 12 2017 14:13
Not really - just the roots install always seems to take a while.
Tom Kraak
@tkraak
Jan 12 2017 14:14
you mean the compile?
Carl Morlock
@gin93r
Jan 12 2017 14:14
No, I mean the install roots -g
Tom Kraak
@tkraak
Jan 12 2017 14:15
you can litterlly watch that process on netlify and I never had issues
not that that helps for this discussion
Carl Morlock
@gin93r
Jan 12 2017 14:16
Hmm... I don't have roots saved as a dependency in my package file so maybe I'll add that as well.
Would save a step
Tom Kraak
@tkraak
Jan 12 2017 14:17
that you need
Carl Morlock
@gin93r
Jan 12 2017 14:17
Yeah - but i was going to run it separately. I'll play with it for a bit and come back with my findings. Thanks for the discussion :)
Tom Kraak
@tkraak
Jan 12 2017 14:18
:thumbsup:
Carl Morlock
@gin93r
Jan 12 2017 14:51
Alright - I got it to build. I needed to update our version of Node.js on the server. Also needed roots as a dependency in package.json (rather than run it separately). Then needed to run compile from node_modules/roots/bin/roots. Thanks for the discussion @tkraak - it helped for sure. :)
Tom Kraak
@tkraak
Jan 12 2017 16:26
:rocket:
Caleb Eby
@calebeby
Jan 12 2017 17:00
@gin93r if you add a compile npm script, your node_modules/.bin/* will be in your PATH so you should be able to have "compile": "roots compile" in your scripts section in package.json. Then run npm run compile
Jeff Escalante
@jescalan
Jan 12 2017 17:48
netlify caches dependencies between builds
so the first build takes a little bit because it has to install roots
but any subsequent build is very fast, unless you have upgraded the roots version
committing the public folder, as mentioned before, is another option, but i dont prefer it
maybe there's some way you can get bamboo to cache a specific directory between builds?
Carl Morlock
@gin93r
Jan 12 2017 17:50
It's all working now and is faster than I thought. I may have confused the install time with a different package.
Jeff Escalante
@jescalan
Jan 12 2017 17:50
if so, just have it hold on to node_modules, then when npm i is run (or even better yarn), it will be very quick
nice! 🎉