AberdeenPHP / AberdeenPHP-Website

Our (open source) website for the AberdeenPHP User Group
http://aberdeenphp.co.uk/
6 stars 4 forks source link

Automate Builds #11

Closed dannyockilson closed 7 years ago

dannyockilson commented 7 years ago

SCSS/JS could be compiled down during the deploy rather than needing to be run on the local machine. Adds consistency (ie you can't forget to do it) and means someone with little experience can edit a scss file and push up a small change without having to set up node/npm/webpack etc. Can set this up but might be best to have a chat about this and see what people are comfortable?

sunscreem commented 7 years ago

Yeah - it sounds sensible to me but the workflow would be very different than I'm used to, not to say we shouldn't do it but I'm struggling to wrap my head around how that would work.

How would I compile the sass locally for example? Interested to hear what @billythekid thinks?

Since laravel have moved to webpack it really is a case of npm install (wait an hour lol) then npm run dev or npm run production (to minify). Oh and npm run watch if you want it to.. well.. watch for changes.

Iiiinteresting...

dannyockilson commented 7 years ago

Yeah you can still run things locally; basically we'd remove the compiled css/js etc from git, you keep it locally for testing. Then when you push the CI runs the npm install && npm run production then deploys the results.

I'm assuming the deployment already runs the composer install and migrations etc? So it'd be pretty similar to how that's done. Can have a chat about this at some point when I've dug around on things a bit more.

billythekid commented 7 years ago

love this idea. half the git conflicts I have are with another Dev whose scss compiler is different from mine on the compiled CSS. add the compiled to gitignore so you can compile locally and test etc

(Rob - edited billy's reply as it included all the rest of the email thread)

sunscreem commented 7 years ago

I'm following ... but ... not wanting to be negative (just wrapping my head around it)

Doesn't that mean my local site could, potentially, be different from the production site?

And isn't it in effect doubling the work? ie. I'd still have to run npm locally anyway?

If everyone's package.json is in sync the compiled code should be identical anyway?

Also - possible spanner in the works. I've turned on versioning on the compiled files. Would we have to turn that off?

dannyockilson commented 7 years ago

It shouldn't make your local dev different to production unless you change the tooling your using locally to do something different. I'm not sure I follow how that would make things different :s

It doesn't increase the work you are doing cause it's automated... Means you can do what you are doing now and nothing has to change but we avoid conflicts in app.css output and avoid someone not building it (me) and it going out of sync ;)

Also the versioning should be fine, we'd just be running the same tooling in the CI you use locally so if it works for you locally doing it it should work fine :)

can chat about this at lunch though cause dunno if this is the clearest way of getting the idea fleshed out

sunscreem commented 7 years ago

Cool - I'm kinda sitting in the "this is going to make life more complicated" camp at the mo. Compiling assets on production sounds like the door being opened to issue to me, however, I'm aware I'm probably only saying this as its not my 'normal' workflow and I'm not sure about it all.

But yeah - good topic for the next lunch for sure.

sunscreem commented 7 years ago

Closing this as I think we've decided against this - FOR NOW lol