Skip to content
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

Support for multiple phoenix applications under an Umbrella App #44

Open
andrewvy opened this issue Oct 28, 2016 · 5 comments
Open

Support for multiple phoenix applications under an Umbrella App #44

andrewvy opened this issue Oct 28, 2016 · 5 comments

Comments

@andrewvy
Copy link

So, I run multiple phoenix applications and each have their own assets.

To get around cd'ing into all the different applications and running the npm deploy script in each..

I just have a custom compile script that looks like this:

cd $build_dir
mix cmd "npm install || true"
mix cmd "npm run deploy || true"
mix phoenix.digest

You can run mix cmd which will run the command in each of all the child applications.

mix phoenix.digest also does run in all of the phoenix applications as well.

I feel like you can use these same commands in a single application, and even in umbrella applications.

@andrewvy andrewvy changed the title Better support for Umbrella Projects Support for multiple phoenix applications under an Umbrella App Oct 28, 2016
@joshprice
Copy link

joshprice commented May 19, 2017

We ended up using something like this where we had multiple Phoenix apps with assets but with a router which didn't have any assets. The router failed to mix ph[oeni]x when priv/static did not exist so we ended up with this solution.

This approach can support Phoenix 1.2 or 1.3 apps. Use yarn by ensuring there is a yarn.lock file in each assets directory.

cd $build_dir

# Phoenix 1.2
mix cmd --app app_a "(yarn install && yarn run deploy) || true"
mix cmd --app app_a mix phoenix.digest

# Phoenix 1.3
mix cmd --app app_b "(cd assets && yarn install && yarn run deploy) || true"
mix cmd --app app_b mix phx.digest

/cc @JonRowe

@joshprice
Copy link

Since this seems to be the simplest way to achieve this, it'd be nice to add some instructions to the README

@edouardmenayde
Copy link

What is the status on this ?
I would be willing to make this feature happen but I'm not sure where I should start. Any idea ?

@JonRowe
Copy link

JonRowe commented Mar 1, 2019

A couple of things need to happen,phx.digest needs to not error in an umbrella context if theres no assets folder, a task needs to be able to exist for installing assets that runs across the umbrella.

@axelson
Copy link

axelson commented May 14, 2020

Specifically the install_and_cache_deps() in build.sh also needs to either support multiple assets directories or have a means to be easily disabled:

install_and_cache_deps() {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants