Push but not compile on Heroku - heroku

Is it possible to just commit things "quickly" to heroku without to have the whole thing parsed/compiled/reinstalled ? Sometimes i feel like it is not needed (for html or css for example)
Thanks for you help

The short answer is no.
The longer answer is yes, provided you are prepared to write your own custom buildpack. It also depends on your technology. Most Heroku buildpacks compile code from source as part of the application deployment. It is possible to create a custom buildpack that takes a pre-compiled binary instead, only updating the application's data or configuration.
For more information see:
https://devcenter.heroku.com/articles/buildpacks
http://www.petekeen.net/introduction-to-heroku-buildpacks

Related

what to do when collaborating and this error: DEPRECATION WARNING: You didn't set config.secret_key_base

I read that you need to run
$ rake secret
And put that in config/initializers/secret_token.rb
However if this is an app that I just recently cloned to collaborate with someone else do they already have a secret key that everyone working on the project should use or should I just generate my own(will this cause problems if I push my code and they then pull it?) Not entirely sure what is the optimal thing to do as its my first time collaborating with others.
Actually the secured_token.rb should not be checked in to version control as it can be used to modify Cookies. You should absolutely generate your own and keep it to yourself. Make sure that your deployment process used a different one. I guess this will become easier (and better standardized) with the Rails 4.1 secrets.yml.

Can you install Google Protocol Buffers on Heroku?

Context
I'm new to Heroku, and fairly new to Google Protocol Buffers.
Steps Taken
Searched Stack Overflow
Searched Heroku help
Searched Google
Question
Is there way to install the Google Protocol Buffers on the Heroku platform?
You do not need to "install" Protobufs to use it at run-time. Just bundle the Protobuf Python code and the code generated by the Protobuf compiler together with your application's other code. The compiler (protoc) is only needed to generate code; it is not used when your application actually runs. So, there should be no problem.
If you want to use the experimental C-extension-backed implementation (which is off by default), you will also need to include the .so file implementing the extension. I am not personally very familiar with C extensions so I'm not sure exactly where you're supposed to put it, but again, you should be able to bundle it with your application without installing anything. I am also not very familiar with Heroku so I do not know if they will let you run C extensions -- I know that AppEngine, in comparison, does not allow extensions.

Any buildpack that can deploy Meteor with PhantomJS support on heroku?

I'd like to run a Meteor.js app with the "spiderable" package on Heroku. Is there a buildpack or anything else to deploy it on Heroku? (PhantomJS in needed)
This buildpack (which I wrote) works with Meteor > 0.9.3 and includes phantomjs:
https://github.com/AdmitHub/meteor-buildpack-horse
I don't know how you're stuck with this, since in practice it's pretty straightforward to install an NPM module as shown in this guide. You only need to swap underscore in that example with phantomjs.
A very good buildpack to use is oortcloud's meteorite buildpack. I've used the meteor-only buildpack, but I've encountered way to many issues with it, but with the aforementioned I have had no problems with it so far.
As for the spiderable package, meteor add spiderable.
Fair warning though: running Meteor on Heroku requires alot of research on how to actually run your app, especially with providing correct environment variables. If you will have a problem with that, this would probably not a good place to discuss any of that.
On a side note: Next time, I implore you to be a little more clear about your problem and specify what your goals really are, and what have you tried so far. Seriously, who upvotes these things?

How to speed up Jekyll/Octopress generation?

I'm using Octopress as my blog engine. It's perfect. But if there are many posts, for example 400+ posts, the speed of generation is soooo slow.
So, is there any way to speed up Jekyll/Octopress generation?
Thanks.
Obviously if you are just working on one post, there is no need to wait for the entire site to generate. What you are looking for is the rake isolate[partial_post_name] task.
Using rake isolate, you can “isolate” only that post you are working on and move all the others to the source/_stash folder. The partial_post_name parameter is just some words in the file name for the post. For example, if I want to isolate the post from the earlier example, I would use
rake isolate[plain-english]
This will move all the other posts to source/_stash and only keep the 2011-09-29-just-type-the-title-of-the-post-here-in-plain-english.markdown post in source/_posts. You can also do this while you are running rake preview. It will just detect a massive change and only regenerate that one post from then on.
by #Pavan Podila
More Info: Tips for Speeding Up Octopress Site Generation
2013.01.08 update:
Hexo--A fast, simple & powerful blog framework, powered by Node.js.
Features:Incredibly fast - generate static files in a glance
2013.6.20 update:
gor -- A static websites and blog generator engine written in Go
gor has following awesome benefits: 1. Speed -- Less than 1 second when compiling all my near 200 blogs on wendal.net 2. Simple -- Only one single executable file generated after compiling, no other dependence
Install Ruby GSL
gem install gsl
You should notice a speed increase.
hexo powered by Node.js. I am using it, much faster than Octopress. And it provides a simple way to migrate your articles to hexo very easily.
You can generate only one post while you are writing it using
rake isolate[your-post]
and then
rake integrate
to go back to normal.
To fully answer your question, you can't generate only one post. You can see Octopress' Issue #395 on that subject, which explains that this is due to a limitation on Jekyll's side.
Reached this post with the same problem, but then did not quite like the idea of rake isolate. Also the inbuilt task does not integrate with the _drafts workflow.
So what I ended up using is to create a custom config.yml with the _posts folder excluded (using exclude) and have only the drafts folder built. You can pass in a different config file as command line parameter to jekyll. I just used this when actively writing new posts and while publish use the same old approach (which still does take some time). This approach builds only the draft post and I am good with that.
jekyll build --watch --drafts --config _previewconfig.yml
For those interested in the complete worklow take a look here
If your blog has a lot of images (and other static assets that do not change between builds), it is worthwhile to exclude them from Jekyll's build process, and instead manually update them as needed.
For whatever reason, Jekyll build is not intelligent when it comes to handling such assets. It will delete everything in the public folder, and re-copy the contents in source every time you build. This is wasteful if the assets haven't changed. This can be avoided by using a tool such as Robocopy (Windows) or Rsync (Linux) that is able to update only what has changed.
To tell Jekyll to ignore a folder, add the following to _config.yml:
exclude: # exclude from build
- folderPath
keep-files: # do not delete/empty copy in `public`
- folderPath
Then elsewhere, use whatever tool you want to update the folder.
For more things you can try, see this post.

Can I use two languages in a Heroku app?

I want to use Node.js as a Share.js server and Ruby for the frontend. As far as I know, Heroku only allows one web-facing process called "web". Does anyone have some experience trying to do something like this?
No, Heroku detects the application type when you push your code to Heroku and it compiles the slug. You'd need to have them as seperate applications with a defined API between the two (not always a bad thing)
UPDATE: You can 'stack' buildpacks these days, eg Ruby + PHP so you could have both executed. See https://devcenter.heroku.com/articles/using-multiple-buildpacks-for-an-app for how to use multiple buildpacks in the same app.
As a caveat, you technically can install two languages on a single app — but I'm not sure about running them concurrently. I made this buildpack to combine NodeJS and PHP (so that I could run Grunt during the slug compilation):
https://github.com/gcpantazis/heroku-buildpack-php-gruntjs
The language detection is usually fairly dumb; it'll be looking for a file indicative of the lang, i.e. index.php or a rakefile. You'll have to change the detect bin so that your code will pass.
Update:
Even better, consider using https://github.com/ddollar/heroku-buildpack-multi ; it'll let you install buildpacks sequentially. Depending on your application you might need to find language buildpacks that don't have verification steps, i.e. checking for a package.json file in a NodeJS app.
Yes, it is mostly possible I believe, as long as you're not doing something very tricky. I once deployed a Flask (Python) app that used Stanford's CoreNLP - which is all written in Java. You will need heroku-buildpack-multi.
After adding this, make sure to make a .buildbacks file and add all the buildpacks you will be needing from the Heroku github.
This circumvents Heroku detecting your app type itself and makes it install all necessary buildpacks from the .buildpacks file.

Resources