Deploying clean meteor 0.9 to heroku - heroku

I am creating a very small and clean meteor app and have recently updated to v0.9 of meteor to be able to get rid of meteorite as "package manager".
For me it is really important in a way not to have any deployment specific stuff wired up into the sourcecode if it is possible.
What I am trying to do in a way is to have a good and clean Continuous Integration running. Right now I am using Codeship to run the tests and then push to heroku. But since I updated top meteor v0.9 there not seems to be a working buildpack.
Is it a reasonable way to create a buildpack on my own? That one would not have to do more than just install node, npm and meteor. Or is there another way to have the app bundled on a "build server" (can codeship do that?) and then have it somehow pushed to heroku as normal node.js app with all the necessities and dependencies?
Concerning the buildpack way:
I have been trying to install meteor via
curl https://install.meteor.com | /bin/sh
But when I run
meteor deploy --directory deploy
I get
bundle: You're not in a Meteor project directory.

This buildpack (which I authored) works for meteor >0.9 using meteor's native packager; no meteorite:
https://github.com/AdmitHub/meteor-buildpack-horse

You could start off with the existing buildpack (or one of the many forks of it).
It should be relatively easy without meteorite since you would no longer have to worry about it, its just getting rid of meteorite and updating the version of node. https://github.com/oortcloud/heroku-buildpack-meteorite
Regarding deploying to heroku. meteor deploy is meant to deploy to *.meteor.com or via Meteor's upcoming commercial product. Deploying to heroku is also relatively easy.
Deploying to heroku is setting up the buildpack, adding the git remote and git pushing to it. Also easy, perhaps easier, than meteor deploy.
During the git push process heroku will take your meteor app, bundle it, download node and run it (as in the buildpack). It's quite easy that way. One nice thing without meteorite is I imagine the build process is much faster.

Related

Cant deploy app to Heroku node modules too big

My node modules by itself take up 500MB.
Heroku only allows 500MB. My complete app is about 700MB. What do web developers do to deploy their app and bypass this problem? It seems create-react-app downloads so much node modules to where it is almost impossible to deploy the app.
Try adding /node_modules to your .gitignore.

Parse Cloud Code development and production version control

I have a Parse application that will soon be used in production, and I need to be able to continue developing things locally without breaking things for live users when I make changes to cloud code.
I have cloned the app, and can now deploy to either the production or staging app using the parse deploy staging and parse deploy production commands, however these commands only work if I am on the master branch.
What I would like to have are two branches in git, one that can be pushed to my staging app, and the other that can be pushed to the production app.
At the moment all I can think of doing is to just tag commits in master as being pushed to production, then continue ontop of that for development, but that is going to be a nightmare if I need to patch the released app when I have all my development changes on master.
Pushing directly to the heroku git repos doesn't seem to work either, parse deploy must be doing something extra (plus it tries to build the app so I can see when things go wrong).
Another issue is that when other developers start working on this as well, we won't be able to all deploy to the development server, and as far as I know there isn't an easy way to run parse cloud code locally on windows.
What is the best way to manage all this?
You have to setup parse-server (use parse-server-example), parse-dashboard and mongoDB on a local or remote development server. You and your team can now develop everything locally, test and then deploy to production.

How do you deploy build artifacts to Heroku from Codeship?

In starting a new project, I put together the skeleton for a Node app that has tests and generates some build artifacts, like asset compilation and compression. I have the tests running in Codeship so successful builds initiate a deploy to Heroku. They've made it all super easy, except I can't find any way to deploy built files, just a copy of what's in the repo.
Has anyone done this successfully? I feel like writing a custom deploy script to rebuild the assets after the tests and manually deploy them would be working against the existing toolset, and I know can't possibly be the first person to want to do this...
Turns out that Codeship doesn't keep anything, in fact, different servers do the deployment than the testing. It seems that the best-practice here is to recreate the assets on the Heroku side with a custom buildpack, which, directly after the git pull, does the dependency installation and compiles the app slug.

How can you retrieve the currently building revision from within a custom Heroku buildpack?

I have a catalog of builds indexed by git revision stored on s3 by our CI server. Instead of performing a build at deploy time, I would like to just download a pre-built application, unpack it and go.
I'm trying to accomplish this with a custom buildpack, but in order to do so, I need for it find out which revision of the code is being compiled. Sadly (for me), I can not find this information anywhere in the environment.
It seems like this is something that ought to be discoverable somehow, but I'm completely flummoxed as to where.
You might want to take a look at the (not officially supported) heroku-anvil plugin, which includes the heroku release command to push externally created slugs to a Heroku app. It was originally designed for working with slugs created with Anvil, but should work for any TAR GZ, as long as it can be run on Heroku. For example you could do something like this:
$ heroku release https://s3.amazonaws.com/my-bucket/slugs-000.tgz -a myapp-staging
Releasing to myapp-staging.heroku.com... done, v42

How to modify the source of an installed package in Heroku?

How do I modify the source of an installed package in Heroku? It's a django app, but I suppose it shouldn't make much of a difference?
Heroku uses Git to manage your source code. Please see the quickstart guide at https://devcenter.heroku.com/articles/quickstart.
You will have to install Heroku Toolbelt, which is a command-line tool. With that application, you will be able to manage and deploy your heroku application.
If you ment 3rd-party addons, I think these are submodules, so you may not be able to modify them.

Resources