public
Last active

exec-and-path-on-heroku-with-buildpacks

  • Download Gist
Procfile
1
scraper: node scraper.js
README.md
Markdown

http://stackoverflow.com/questions/12792191/exec-and-path-on-heroku-with-buildpacks

$ git clone git://gist.github.com/3856317.git
Cloning into '3856317'...
remote: Counting objects: 15, done.
remote: Compressing objects: 100% (14/14), done.
remote: Total 15 (delta 2), reused 0 (delta 0)
Receiving objects: 100% (15/15), done.
Resolving deltas: 100% (2/2), done.
$ cd 3856317
$ heroku create --buildpack https://github.com/abernier/heroku-buildpack-casperjs.git
Creating frozen-crag-6457... done, stack is cedar
BUILDPACK_URL=https://github.com/abernier/heroku-buildpack-casperjs.git
http://frozen-crag-6457.herokuapp.com/ | git@heroku.com:frozen-crag-6457.git
Git remote heroku added
$ git push heroku master
Counting objects: 15, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (12/12), done.
Writing objects: 100% (15/15), 1.63 KiB, done.
Total 15 (delta 2), reused 15 (delta 2)

-----> Heroku receiving push
-----> Fetching custom git buildpack... done
-----> PhantomJS app detected
-----> Fetching PhantomJS buildpack binaries
-----> Extracting PhantomJS binaries
-----> Cloning casperjs
Initialized empty Git repository in /tmp/build_33735ns6eeqrh/vendor/casperjs/.git/
-----> Discovering process types
       Procfile declares types     -> scraper
       Default types for PhantomJS -> console
-----> Compiled slug size: 17.3MB
-----> Launching... done, v4
       http://frozen-crag-6457.herokuapp.com deployed to Heroku

To git@heroku.com:frozen-crag-6457.git
 * [new branch]      master -> master
$ heroku ps:scale scraper=1
Scaling scraper processes... done, now running 1
$ heroku logs
2012-10-09T03:06:35+00:00 heroku[api]: Add BUILDPACK_URL config by antoine.bernier@gmail.com
2012-10-09T03:06:35+00:00 heroku[api]: Release v2 created by antoine.bernier@gmail.com
2012-10-09T03:07:01+00:00 heroku[slugc]: Slug compilation started
2012-10-09T03:07:15+00:00 heroku[api]: Add LD_LIBRARY_PATH, PATH config by antoine.bernier@gmail.com
2012-10-09T03:07:15+00:00 heroku[api]: Release v3 created by antoine.bernier@gmail.com
2012-10-09T03:07:16+00:00 heroku[api]: Release v4 created by antoine.bernier@gmail.com
2012-10-09T03:07:16+00:00 heroku[api]: Deploy d52de33 by antoine.bernier@gmail.com
2012-10-09T03:07:16+00:00 heroku[web.1]: State changed from starting to down
2012-10-09T03:07:16+00:00 heroku[slugc]: Slug compilation finished
2012-10-09T03:07:25+00:00 heroku[api]: Scale to scraper=1 by antoine.bernier@gmail.com
2012-10-09T03:07:27+00:00 heroku[scraper.1]: Starting process with command `node scraper.js`
2012-10-09T03:07:28+00:00 app[scraper.1]: bash: node: command not found
2012-10-09T03:07:28+00:00 heroku[scraper.1]: State changed from starting to crashed
2012-10-09T03:07:28+00:00 heroku[scraper.1]: State changed from crashed to starting
2012-10-09T03:07:29+00:00 heroku[scraper.1]: Process exited with status 127
2012-10-09T03:07:30+00:00 heroku[scraper.1]: Starting process with command `node scraper.js`
2012-10-09T03:07:31+00:00 app[scraper.1]: bash: node: command not found
2012-10-09T03:07:31+00:00 heroku[scraper.1]: State changed from starting to up
2012-10-09T03:07:32+00:00 heroku[scraper.1]: Process exited with status 127
2012-10-09T03:07:32+00:00 heroku[scraper.1]: State changed from up to crashed
casper-script.js
JavaScript
1 2 3 4 5 6 7 8
var casper = require('casper').create();
 
casper.start('http://google.com/', function () {
console.log(this.evaluate(function () {
return document.title;
}));
});
casper.run();
package.json
JSON
1 2 3 4 5 6 7 8
{
"name": "test",
"version": "0.0.1",
"engines": {
"node": "0.8.x",
"npm": "1.1.x"
}
}
scraper.js
JavaScript
1 2 3
var exec = require('child_process').exec;
 
exec('casperjs casper-script.js');

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.