-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
General notes for getting up and running with distillery #1
Comments
@bitwalker I added you here to reduce noise round the documentation which we discussed here: bitwalker/distillery#2 . I will of course be following a normal PR workflow, but I needed a place to drop notes + have a simple example project that I could both refer to and use as extra documentation. My ETA for a first PR draft is sometime tomorrow (Aug 16) |
Im having issues getting javascript assets to update in releases. I have setup a socket which I am planning to use for testing that sockets are held open during the upgrade. Current versions: 0.0.1 -> default app from phoenix.new Upcoming versions 0.0.4 -> Socket is modified to emit odd numbers every 1000ms Current status Upping from 0.0.1 -> 0.0.2 works great 0.0.2 -> 0.0.3 does not seem to be delivering the new js (possible cache issue?) |
I suspect that's a caching issue, are you running |
I am indeed, which is why it is curious. I will be poking this more tonight for sure |
If the digest hash for the assets isn't changing after a refresh then there's definitely an issue, but if it is but things aren't updating appropriately, I'm not sure what would cause that. |
@bitwalker sorry for the delay on this; I have been trying to figure out what is happening to no avail. The js assets hash is definitely not changing for the 0.0.2 -> 0.0.3 release; which is odd, because between 0.0.1 -> 0.0.2 the css asset hash changed without issue. This is the command I am running to build an update (including the asset build step) is:
if you look at 7cc39d1 , you can see that the socket.js file definitely changes. As far as I can tell, the asset hash for my css is changing properly, the asset hash for the js is not. |
I'll see if I can find some time to look at this today, with both our eyes on it, we can get it sorted :) |
Interesting development. Looking at Plug.Static's Caching Options I set While I think this makes some sort of sense, ill be darned if that isn't a gotcha! |
And I can now confirm that hot uploading the socket code works gloriously. Coolest thing I have seen all week! Now that I have a decent working example, I can get a draft of a phoenix oriented walkthrough together. Im not entirely sure what happened with Thanks for offering to take a look @bitwalker! |
@supernullset Interesting, it makes sense why it would serve the old version if the In any case, I suppose it's at least something we can make a note of in the short term until we figure out exactly what's causing that behaviour - to the best of my knowledge though that appears to be a bug. |
I've noticed in the phoenix docs:
There is also some info below, why this is needed for releases and hot reloading. Maybe this can somehow help. |
Yeah all of those things still hold true, though if you'd missed those steps I don't think the upgrades would've worked at all, where in your case the assets partially updated. |
@vladshcherbin good catch and thanks for linking me. I did not set root or version, which seems like a likely culprit. I am surprised that the upgrades worked without either of those being set. Ill rollback and run through the test again with these in place |
@bitwalker @vladshcherbin Sorry for the delay on this; I have been out of town for a few days and could not sit down to wrap this up. I have a doc draft of a walkthrough in progress but I have a few questions about the issue which @vladshcherbin raised. Setting |
When a new version is installed,
Basically this is due to the fact that Phoenix manages it's own configuration cache, and because it must be told where to look for assets. I believe this latter one could probably be fixed, but I haven't had time to try and look into it myself. In any case, hopefully that clears up any confusion :) |
@supernullset I'm actually very interested in this tutorial as the environment where you build your release has to be the same as on production server (if you build on os x and run on ubuntu - it won't work). The official documentation also tells you that but omits this whole step leaving it for user to figure out. I'm curious, if your tutorial will have this step :) |
@bitwalker Thanks for that walkthrough; extremely useful explanation. I just found it odd that the knobs required for configuring a release don't seem to show up in any of the module docs! Understanding the details really helps. @vladshcherbin I keep a Vagrant machine in each of my projects which is a mirror of the OS which I have running in production. Generally I have been doing active development in my local environment (OSX), then when I am ready for a release I fire up my Vagrant VM, build a release, and The current Distillery Walkthrough does mention that the |
@supernullset yep, a small guide somewhere would be awesome because if you want to do releases, you are basically forced to learn how docker or vagrant works. |
@vladshcherbin Ill put something together in the next 2 days! |
mix release
by itself does not make sense to use, and in fact will not produce a runnable executable.phoenix-live-reload
in developmentserver: true
must be set in theconfig/prod.exs
fileMIX_ENV=prod mix release --env=prod
builds a working release after the above steps are completed.The text was updated successfully, but these errors were encountered: