gjaldon / heroku-buildpack-phoenix-static

A Heroku buildpack for building Phoenix's static assets
MIT License
229 stars 224 forks source link

should `default_process_type` pick up my buildpack.config's `phoenix_ex` value? #81

Closed rccursach closed 5 years ago

rccursach commented 5 years ago

In the readme says:

# We can change phoenix mix namespace tasks. E.g. phx for phoenix 1.3 support.
phoenix_ex=phoenix

But, even if I put phoenix_ex=phx into my phoenix_static_buildpack.config file, if im not explicitly creating a Procfile to run web: mix phx.server will default to run phoenix.server. that confused me for a while...

I guess, it's because of the content of bin/release:

default_process_types:
  web: mix phoenix.server

Then I can see in my logs: app[web.1] mix phoenix.webserver is deprecated. Use phx.server instead.

It's possible to tell the buildpack to catch this phoenix_ex value to insert it into the default line? or state this behavior on the cited line of the readme?

rccursach commented 5 years ago

Hi @gjaldon , I've set up a phoenix 1.3.x with dokku to try this.

added this to my .buildpacks:

https://github.com/HashNuke/heroku-buildpack-elixir.git
https://github.com/gjaldon/heroku-buildpack-phoenix-static.git#var-in-release

When using #master things runs ok because it picks up phx instead of phoenix, but with #var-in-release I got this:

** (Mix) The task ".server" could not be found. Did you mean "phx.server"?

But this message from lib/common changes accordingly to my .config file:

Will use phoenix configuration:
       * assets path assets
       * mix tasks namespace phx

(according to the value of phoenix_ex inside phoenix_static_buildpack.config)

It may be a thing of Dokku, when running the release script... let me test it with heroku too.

But maybe is less trouble just to leave the branch that references phoenix instead of phx, as a solution. Maybe, there's a minority of apps with phoenix < 1.3.x out there?

rccursach commented 5 years ago

UPD: Same with Heroku.. Screen Shot 2019-03-11 at 9 21 15 PM

And Dokku:

Screen Shot 2019-03-11 at 8 29 02 PM

I think I made the issue because I had already tried to use the var ${phoenix_ex} back then.. 🤔. Maybe is no big deal to just have a branch for old apps ? 😆

gjaldon commented 5 years ago

@rccursach just updated the branch https://github.com/gjaldon/heroku-buildpack-phoenix-static/pull/87. This time, I loaded the config vars inside bin/release. Can you test it out? :)

rccursach commented 5 years ago

it gives this: "mapping values are not allowed in this context at line 4 column 15" :/

With or without a phoenix_static_buildpack.config. Idk what part of the code is parsing a YAML file though.

Screen Shot 2019-03-12 at 4 37 47 PM

rccursach commented 5 years ago

The above error happens bc what's echoed by the load_config() is added to the YAML output of release. it works now in pr #88 for the var-in-release branch

gjaldon commented 5 years ago

Addressed in #88