-
Notifications
You must be signed in to change notification settings - Fork 82
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
Discussion: Iron as a build tool #78
Comments
Ahh! Now I see, the complete meteor app is in /app/ instead of in the root. So the app can be built and run by meteor simply by I kind of like that, but still it will require custom heroku buildpacks but it shouldn't break to easily once done with this structure. |
The meteor app is in the app directory as you pointed out. You can either cd into the app directory and run any meteor commands as usual, or you can just use the iron command line tool from the project folder. If you run one of the meteor commands it will be run in the context of the app folder (the iron cli just proxies any meteor commands to the meteor cli). Does the heroku build pack rely on something about the old project structure? Like the config folder or something? |
Btw the main reason for proxying commands to the meteor cli is because of the super project structure for config and other stuff we don't want to end up in the build process. For example, you might have some maintenance tools and scripts in the bin folder that aren't really part of the built app. But it's annoying to have to cd into the app directory just to run the app or add a package :). |
Testing deploying to Heroku with the new project structure. Heroku apps are deployed via git push of the actual source code so the buildpack need to have an understanding of what the project looks like and existing build packs assume the meteor project is in the root of the repo.
which will give you:
However if I move the content of /app/ to the root and push commit+push again it works. Conclusion, we have to create our own buildpack or provide patches for the popular ones. We could first look for /.meteor (in the root) and if it's not there we look for /app/.meteor before we abort with failure. |
Heroku is weird in that it requires git push to deploy, so you will still push the whole project to Heroku (including tools and stuff you don't want in your bundle), but the final meteor bundle will be created from the /app folder (with our patch) so it will still make a clean app build and deployment. Anyhow, I like the idea of the super project structure so I think we should just patch the Horse buildpack and we're good. |
Another potential risk with proxying commands to meteor is that if meteor add a new command name that we already use. But we could name space it so it's not likely that will happen, and worst case we'll just change our command name there is a future clash. Have some additional thoughts on commands/flags, I'll start a separate issue for it shortly. |
Oh I see (re the buildpack). But don't we need the heroku build pack to recognize configuration settings? Or, do people using Heroku do something different? I would think the build pack should run the meteor app in production mode, bringing in the appropriate settings and env for the production environment. Should we just write our own build pack that works? Or send a PR to the popular ones? I agree there's a little risk of namespacing conflicts between iron and meteor. But I'm hoping the iron surface area is small enough that it won't be a real issue in practice. I do keep an array of all valid meteor methods, so if they add a new one, or remove one, we'll have to update that array. This is how I'm able to show the usage help for iron instead of just proxying any unknown thing to meteor and showing a random meteor failure. |
You configure the buildpack to do what ever you want, eg configuring a mongoDB, downloading meteor, creating a bundle and starting meteor, etc. The buildpack is run when you git push a new commit to Heroku. Environment vars are set from the command line like this (example with Meteor special vars):
So you can do I usually have two apps att heroku, production and staging, plus dev. locally. Also I've mostly done closed source project so then I just put a JS file in /server/lib/ with config (smtp keys etc) for all three environment and commit it. Then my app loads staging config for staging based on the environment the Heroku app has (eg |
Btw. I think we should choose an existing buildpack and contribute to it. Less work :) Better share the burden. I've lately used https://github.com/AdmitHub/meteor-buildpack-horse - it seems to be an active project. It doesn't handle Iron's configs but at least you can deploy, so on par with what we had before the new project structure. |
A nice way would be to make another patch to the buildpack to make it handle environments and configs the iron way. Eg the build pack should export I'll look into it. |
In production I symlink to a production config folder. For example, in production:
Then protect the shared folder so that it can only be ready by the deployer or administrator user. Not sure what a good workflow should be for Heroku. |
As a first step I've modified the first Heroku buildpack to support the new project structure https://github.com/lirbank/meteor-buildpack-horse I've created a PR too, let's see if the maintainer pull it in AdmitHub/meteor-buildpack-horse#18 |
Thanks Mikael!
|
closing to keep track of other issues. can continue discussion though. deployment should work :) |
or will keep open and mark as idea |
yep thanks |
Just had a brief look at the new iron with new project structure.
I must admit I am somewhat split to the idea of having iron as a build tool and passthrough of commands to meteor. I am advocate of simplicity so I am asking myself, will there really be enough benefits to justify the added complexity? Not only code maintenance but also, we will not be able to use "standard" buildpacks for deploying on Heroku (and later on Galaxy), or no? If we keep the folder structure in a way that meteor can use natively I think a lot of future issues can be avoided.
The text was updated successfully, but these errors were encountered: