saxifrage / cityasacampus

An open-source platform for connecting and showcasing resources within local learning communities.
http://cityasacampus.org/
5 stars 4 forks source link

attempting Heroku deployment #358

Closed MatthewVita closed 8 years ago

MatthewVita commented 8 years ago

@whit537 starting out here.

Going to set up a fresh heroku box and try these rake tasks. I'm not sure if doing the steps through rake tasks is the most elegant approach, tbh.

chadwhitacre commented 8 years ago
$ heroku buildpacks:clear
Buildpacks cleared. Next release on still-tor-9977 will detect buildpack normally.
$ heroku buildpacks:add heroku/nodejs
Buildpack added. Next release on still-tor-9977 will use heroku/nodejs.
Run git push heroku master to create a new release using this buildpack.
$ heroku buildpacks:add heroku/ruby
Buildpack added. Next release on still-tor-9977 will use:
  1. heroku/nodejs
  2. heroku/ruby
Run git push heroku master to create a new release using these buildpacks.
$
chadwhitacre commented 8 years ago

If you relogin to the instance, it will be gone

That's because a "relogin" is actually spinning up a new dyno, which is starting from a clean app state:

$ heroku ps
=== web (Free): bundle exec puma -C config/puma.rb
web.1: idle 2015/11/27 16:31:58

$ heroku run sleep 1 &
[2] 72472
$ Running sleep 1 on still-tor-9977... up, run.8459

$ heroku ps
=== web (Free): bundle exec puma -C config/puma.rb
web.1: idle 2015/11/27 16:31:58

=== run: one-off processes
run.8459 (Free): up 2015/11/30 12:01:47 (~ 1s ago): sleep 1

[2]+  Stopped                 heroku run sleep 1
$

screen shot 2015-11-30 at 12 02 06 pm

chadwhitacre commented 8 years ago

@MatthewVita Fwiw, the broad design of Heroku's architecture is described in "The Twelve Factor App":

The twelve-factor app never assumes that anything cached in memory or on disk will be available on a future request or job – with many processes of each type running, chances are high that a future request will be served by a different process.

http://12factor.net/processes

chadwhitacre commented 8 years ago

/app/client doesn't technically exist on disk at this point in time.

Really?

$ heroku run ls -FGl /app/client
Running ls -FGl /app/client on still-tor-9977... up, run.8378
total 12
drwx------ 8 u16739 4096 Nov 27 19:56 app/
-rw------- 1 u16739 2640 Nov 27 19:56 gulpfile.js
-rw------- 1 u16739  755 Nov 27 19:56 package.json
$
chadwhitacre commented 8 years ago

Here's the error I get trying to push 6e48bccb1a179af9db7fe18edf8d1517822643c6 to Heroku (with buildpacks heroku/nodejs and heroku/ruby):

remote: Compressing source files... done.        
remote: Building source:        
remote: 
remote: -----> Using set buildpack heroku/nodejs        
remote: -----> Node.js app detected        
remote: 
remote: -----> Creating runtime environment        
remote:                
remote:        NPM_CONFIG_LOGLEVEL=error        
remote:        NPM_CONFIG_PRODUCTION=true        
remote:        NODE_ENV=production        
remote:        NODE_MODULES_CACHE=true        
remote: 
remote: -----> Installing binaries        
remote:        engines.node (package.json):  4.1.1        
remote:        engines.npm (package.json):   2.1.x        
remote:                
remote:        Downloading and installing node 4.1.1...        
remote:        Resolving npm version 2.1.x via semver.io...        
remote:        Downloading and installing npm 2.1.18 (replacing version 2.14.4)...        
remote: 
remote: -----> Restoring cache        
remote:        Skipping cache restore (new runtime signature)        
remote: 
remote: -----> Building dependencies        
remote:        Pruning any extraneous modules        
remote:        Installing node modules (package.json)        
remote:                
remote:        > city-as-a-campus@1.0.0 postinstall /tmp/build_3b96f3e2fb66579af094627818465593        
remote:        > cd ~/client && npm uninstall --save-dev gulp-sass && npm install --save-dev gulp-sass@2 && npm install && npm install -g gulp && gulp production        
remote:                
remote:        sh: 1: cd: can't cd to /app/client        
remote:                
remote:        npm ERR! Linux 3.13.0-66-generic        
remote:        npm ERR! argv "/tmp/build_3b96f3e2fb66579af094627818465593/.heroku/node/bin/node" "/tmp/build_3b96f3e2fb66579af094627818465593/.heroku/node/bin/npm" "install" "--unsafe-perm" "--userconfig" "/tmp/build_3b96f3e2fb66579af094627818465593/.npmrc"        
remote:        npm ERR! node v4.1.1        
remote:        npm ERR! npm  v2.1.18        
remote:        npm ERR! code ELIFECYCLE        
remote:        npm ERR! city-as-a-campus@1.0.0 postinstall: `cd ~/client && npm uninstall --save-dev gulp-sass && npm install --save-dev gulp-sass@2 && npm install && npm install -g gulp && gulp production`        
remote:        npm ERR! Exit status 2        
remote:        npm ERR!        
remote:        npm ERR! Failed at the city-as-a-campus@1.0.0 postinstall script 'cd ~/client && npm uninstall --save-dev gulp-sass && npm install --save-dev gulp-sass@2 && npm install && npm install -g gulp && gulp production'.        
remote:        npm ERR! This is most likely a problem with the city-as-a-campus package,        
remote:        npm ERR! not with npm itself.        
remote:        npm ERR! Tell the author that this fails on your system:        
remote:        npm ERR!     cd ~/client && npm uninstall --save-dev gulp-sass && npm install --save-dev gulp-sass@2 && npm install && npm install -g gulp && gulp production        
remote:        npm ERR! You can get their info via:        
remote:        npm ERR!     npm owner ls city-as-a-campus        
remote:        npm ERR! There is likely additional logging output above.        
remote:                
remote:        npm ERR! Please include the following file with any support request:        
remote:        npm ERR!     /tmp/build_3b96f3e2fb66579af094627818465593/npm-debug.log        
remote: 
remote: -----> Build failed        
remote:                
remote:        We're sorry this build is failing! You can troubleshoot common issues here:        
remote:        https://devcenter.heroku.com/articles/troubleshooting-node-deploys        
remote:                
remote:        If you're stuck, please submit a ticket so we can help:        
remote:        https://help.heroku.com/        
remote:                
remote:        Love,        
remote:        Heroku        
remote:                
remote: 
remote:  !     Push rejected, failed to compile Node.js app        
remote: 
remote: Verifying deploy...        
remote: 
remote: !   Push rejected to still-tor-9977.        
remote: 
To https://git.heroku.com/still-tor-9977.git
 ! [remote rejected] heroku-matthew -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/still-tor-9977.git'
chadwhitacre commented 8 years ago

It errors with ./postinstall.sh: line 3: cd: /app/client: No such file or directory

Looks like we're on close to the same page, anyway, @MatthewVita. :-)

chadwhitacre commented 8 years ago
$ heroku run 'cd ~/client && ls'
Running cd ~/client && ls on still-tor-9977... up, run.6813
app  gulpfile.js  package.json
$
chadwhitacre commented 8 years ago

In the gulp-rails-pipeline example, the post-install script is simply gulp build. Would adopting the same pattern improve our debuggability at all?

chadwhitacre commented 8 years ago

Looks like we've been trying to keep our Gulp pipeline nested in the client directory. I'm going to look at adopting the pattern in gulp-rails-pipeline since apparently that's a working example.

chadwhitacre commented 8 years ago

On second though, maybe this can help?

--gulpfile <gulpfile path> will manually set path of gulpfile. Useful if you have multiple gulpfiles. This will set the CWD to the gulpfile directory as well

chadwhitacre commented 8 years ago

Error log with 893132ab49c9571a2dcc4d9e131d983efb8637bc:

remote: Compressing source files... done.        
remote: Building source:        
remote: 
remote: -----> Using set buildpack heroku/nodejs        
remote: -----> Node.js app detected        
remote: 
remote: -----> Creating runtime environment        
remote:                
remote:        NPM_CONFIG_LOGLEVEL=error        
remote:        NPM_CONFIG_PRODUCTION=true        
remote:        NODE_ENV=production        
remote:        NODE_MODULES_CACHE=true        
remote: 
remote: -----> Installing binaries        
remote:        engines.node (package.json):  4.1.1        
remote:        engines.npm (package.json):   2.1.x        
remote:                
remote:        Downloading and installing node 4.1.1...        
remote:        Resolving npm version 2.1.x via semver.io...        
remote:        Downloading and installing npm 2.1.18 (replacing version 2.14.4)...        
remote: 
remote: -----> Restoring cache        
remote:        Skipping cache restore (new runtime signature)        
remote: 
remote: -----> Building dependencies        
remote:        Pruning any extraneous modules        
remote:        Installing node modules (package.json)        
remote:                
remote:        > city-as-a-campus@1.0.0 postinstall /tmp/build_dbc775af253c762325a3f10c27577fae        
remote:        > gulp --gulpfile client/gulpfile.js production        
remote:                
remote:        [19:12:14] Working directory changed to /tmp/build_dbc775af253c762325a3f10c27577fae/client        
remote:        module.js:338        
remote:        throw err;        
remote:        ^        
remote:                
remote:        Error: Cannot find module 'gulp-sourcemaps'        
remote:        at Function.Module._resolveFilename (module.js:336:15)        
remote:        at Function.Module._load (module.js:286:25)        
remote:        at Module.require (module.js:365:17)        
remote:        at require (module.js:384:17)        
remote:        at Object.<anonymous> (/tmp/build_dbc775af253c762325a3f10c27577fae/client/gulpfile.js:2:18)        
remote:        at Module._compile (module.js:434:26)        
remote:        at Object.Module._extensions..js (module.js:452:10)        
remote:        at Module.load (module.js:355:32)        
remote:        at Function.Module._load (module.js:310:12)        
remote:        at Module.require (module.js:365:17)        
remote:                
remote:        npm ERR! Linux 3.13.0-66-generic        
remote:        npm ERR! argv "/tmp/build_dbc775af253c762325a3f10c27577fae/.heroku/node/bin/node" "/tmp/build_dbc775af253c762325a3f10c27577fae/.heroku/node/bin/npm" "install" "--unsafe-perm" "--userconfig" "/tmp/build_dbc775af253c762325a3f10c27577fae/.npmrc"        
remote:        npm ERR! node v4.1.1        
remote:        npm ERR! npm  v2.1.18        
remote:        npm ERR! code ELIFECYCLE        
remote:        npm ERR! city-as-a-campus@1.0.0 postinstall: `gulp --gulpfile client/gulpfile.js production`        
remote:        npm ERR! Exit status 1        
remote:        npm ERR!        
remote:        npm ERR! Failed at the city-as-a-campus@1.0.0 postinstall script 'gulp --gulpfile client/gulpfile.js production'.        
remote:        npm ERR! This is most likely a problem with the city-as-a-campus package,        
remote:        npm ERR! not with npm itself.        
remote:        npm ERR! Tell the author that this fails on your system:        
remote:        npm ERR!     gulp --gulpfile client/gulpfile.js production        
remote:        npm ERR! You can get their info via:        
remote:        npm ERR!     npm owner ls city-as-a-campus        
remote:        npm ERR! There is likely additional logging output above.        
remote:                
remote:        npm ERR! Please include the following file with any support request:        
remote:        npm ERR!     /tmp/build_dbc775af253c762325a3f10c27577fae/npm-debug.log        
remote: 
remote: -----> Build failed        
remote:                
remote:        We're sorry this build is failing! You can troubleshoot common issues here:        
remote:        https://devcenter.heroku.com/articles/troubleshooting-node-deploys        
remote:                
remote:        If you're stuck, please submit a ticket so we can help:        
remote:        https://help.heroku.com/        
remote:                
remote:        Love,        
remote:        Heroku        
remote:                
remote: 
remote:  !     Push rejected, failed to compile Node.js app        
remote: 
remote: Verifying deploy...        
remote: 
remote: !   Push rejected to still-tor-9977.        
remote: 
To https://git.heroku.com/still-tor-9977.git
 ! [remote rejected] heroku-matthew -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/still-tor-9977.git'
chadwhitacre commented 8 years ago

Error: Cannot find module 'gulp-sourcemaps'

That could be due to dependencies vs. devDependencies, eh?

chadwhitacre commented 8 years ago

Interesting:

remote:        [19:12:14] Working directory changed to /tmp/build_dbc775af253c762325a3f10c27577fae/client

So it looks like Heroku is compiling the slug in /tmp/build_dbc775af253c762325a3f10c27577fae. Presumably at some point it mvs that to /app?

chadwhitacre commented 8 years ago

So it looks like Heroku is compiling the slug in /tmp/build_dbc775af253c762325a3f10c27577fae. Presumably at some point it mvs that to /app?

And presumably the temporary directory is the BUILD_DIR referred to in the buildpack API docs.

chadwhitacre commented 8 years ago

Folding devDependencies into dependencies (28004244f0c74660044b6ee16aa52484caba4b73) yielded the same error as at . However, moving the deps up to the top-level package.json (c0700ec828d8dd743505e80970bc64a16b656de0) yields:

remote: Compressing source files... done.        
remote: Building source:        
remote: 
remote: -----> Using set buildpack heroku/nodejs        
remote: -----> Node.js app detected        
remote: 
remote: -----> Creating runtime environment        
remote:                
remote:        NPM_CONFIG_LOGLEVEL=error        
remote:        NPM_CONFIG_PRODUCTION=true        
remote:        NODE_ENV=production        
remote:        NODE_MODULES_CACHE=true        
remote: 
remote: -----> Installing binaries        
remote:        engines.node (package.json):  4.1.1        
remote:        engines.npm (package.json):   2.1.x        
remote:                
remote:        Downloading and installing node 4.1.1...        
remote:        Resolving npm version 2.1.x via semver.io...        
remote:        Downloading and installing npm 2.1.18 (replacing version 2.14.4)...        
remote: 
remote: -----> Restoring cache        
remote:        Skipping cache restore (new runtime signature)        
remote: 
remote: -----> Building dependencies        
remote:        Pruning any extraneous modules        
remote:        Installing node modules (package.json)        
remote:                
remote:        > node-sass@2.1.1 install /tmp/build_6cdc6062f746279677e20658a46a9cc8/node_modules/gulp-sass/node_modules/node-sass        
remote:        > node scripts/install.js        
remote:                
remote:        Can not download file from https://raw.githubusercontent.com/sass/node-sass-binaries/v2.1.1/linux-x64-node-4.1/binding.node        
remote:                
remote:        > node-sass@2.1.1 postinstall /tmp/build_6cdc6062f746279677e20658a46a9cc8/node_modules/gulp-sass/node_modules/node-sass        
remote:        > node scripts/build.js        
remote:                
remote:        make: Entering directory `/tmp/build_6cdc6062f746279677e20658a46a9cc8/node_modules/gulp-sass/node_modules/node-sass/build'        
remote:        CXX(target) Release/obj.target/binding/src/binding.o        
remote:        In file included from ../src/binding.cpp:1:0:        
remote:        ../node_modules/nan/nan.h:324:27: error: redefinition of ‘template<class T> v8::Local<T> Nan::imp::NanEnsureHandleOrPersistent(const v8::Local<T>&)’        
remote:        NAN_INLINE v8::Local<T> NanEnsureHandleOrPersistent(const v8::Local<T> &val) {        
remote:        ^        
remote:        ../node_modules/nan/nan.h:319:17: error: ‘template<class T> v8::Handle<T> Nan::imp::NanEnsureHandleOrPersistent(v8::Handle<T>&)’ previously declared here        
remote:        v8::Handle<T> NanEnsureHandleOrPersistent(const v8::Handle<T> &val) {        
remote:        ^        
remote:        ../node_modules/nan/nan.h:344:27: error: redefinition of ‘template<class T> v8::Local<T> Nan::imp::NanEnsureLocal(v8::Handle<T>&)’        
remote:        NAN_INLINE v8::Local<T> NanEnsureLocal(const v8::Handle<T> &val) {        
remote:        ^        
remote:        ../node_modules/nan/nan.h:334:27: error: ‘template<class T> v8::Local<T> Nan::imp::NanEnsureLocal(const v8::Local<T>&)’ previously declared here        
remote:        NAN_INLINE v8::Local<T> NanEnsureLocal(const v8::Local<T> &val) {        
remote:        ^        
remote:        ../node_modules/nan/nan.h:757:13: error: ‘node::smalloc’ has not been declared        
remote:        , node::smalloc::FreeCallback callback        
remote:        ^        
remote:        ../node_modules/nan/nan.h:757:35: error: expected ‘,’ or ‘...’ before ‘callback’        
remote:        , node::smalloc::FreeCallback callback        
remote:        ^        
remote:        ../node_modules/nan/nan.h: In function ‘v8::Local<v8::Object> NanNewBufferHandle(char*, size_t, int)’:        
remote:        ../node_modules/nan/nan.h:761:50: error: ‘callback’ was not declared in this scope        
remote:        v8::Isolate::GetCurrent(), data, length, callback, hint);        
remote:        ^        
remote:        ../node_modules/nan/nan.h:761:60: error: ‘hint’ was not declared in this scope        
remote:        v8::Isolate::GetCurrent(), data, length, callback, hint);        
remote:        ^        
remote:        ../node_modules/nan/nan.h: In function ‘v8::Local<v8::Object> NanNewBufferHandle(const char*, uint32_t)’:        
remote:        ../node_modules/nan/nan.h:768:67: error: call of overloaded ‘New(v8::Isolate*, const char*&, uint32_t&)’ is ambiguous        
remote:        return node::Buffer::New(v8::Isolate::GetCurrent(), data, size);        
remote:        ^        
remote:        ../node_modules/nan/nan.h:768:67: note: candidates are:        
remote:        In file included from ../node_modules/nan/nan.h:25:0,        
remote:        from ../src/binding.cpp:1:        
remote:        /app/.node-gyp/4.1.1/src/node_buffer.h:31:40: note: v8::MaybeLocal<v8::Object> node::Buffer::New(v8::Isolate*, v8::Local<v8::String>, node::encoding) <near match>        
remote:        NODE_EXTERN v8::MaybeLocal<v8::Object> New(v8::Isolate* isolate,        
remote:        ^        
remote:        /app/.node-gyp/4.1.1/src/node_buffer.h:31:40: note:   no known conversion for argument 3 from ‘uint32_t {aka unsigned int}’ to ‘node::encoding’        
remote:        /app/.node-gyp/4.1.1/src/node_buffer.h:43:40: note: v8::MaybeLocal<v8::Object> node::Buffer::New(v8::Isolate*, char*, size_t) <near match>        
remote:        NODE_EXTERN v8::MaybeLocal<v8::Object> New(v8::Isolate* isolate,        
remote:        ^        
remote:        /app/.node-gyp/4.1.1/src/node_buffer.h:43:40: note:   no known conversion for argument 2 from ‘const char*’ to ‘char*’        
remote:        In file included from ../src/binding.cpp:1:0:        
remote:        ../node_modules/nan/nan.h: In function ‘v8::Local<v8::Object> NanNewBufferHandle(uint32_t)’:        
remote:        ../node_modules/nan/nan.h:772:61: error: could not convert ‘node::Buffer::New(v8::Isolate::GetCurrent(), ((size_t)size))’ from ‘v8::MaybeLocal<v8::Object>’ to ‘v8::Local<v8::Object>’        
remote:        return node::Buffer::New(v8::Isolate::GetCurrent(), size);        
remote:        ^        
remote:        ../node_modules/nan/nan.h: In function ‘v8::Local<v8::Object> NanBufferUse(char*, uint32_t)’:        
remote:        ../node_modules/nan/nan.h:779:12: error: ‘Use’ is not a member of ‘node::Buffer’        
remote:        return node::Buffer::Use(v8::Isolate::GetCurrent(), data, size);        
remote:        ^        
remote:        ../src/binding.cpp: In function ‘void dispatched_async_uv_callback(uv_async_t*)’:        
remote:        ../src/binding.cpp:70:35: warning: ‘void node::FatalException(const v8::TryCatch&)’ is deprecated (declared at /app/.node-gyp/4.1.1/src/node.h:282): Use FatalException(isolate, ...) [-Wdeprecated-declarations]        
remote:        node::FatalException(try_catch);        
remote:        ^        
remote:        ../src/binding.cpp: In function ‘void make_callback(uv_work_t*)’:        
remote:        ../src/binding.cpp:245:35: warning: ‘void node::FatalException(const v8::TryCatch&)’ is deprecated (declared at /app/.node-gyp/4.1.1/src/node.h:282): Use FatalException(isolate, ...) [-Wdeprecated-declarations]        
remote:        node::FatalException(try_catch);        
remote:        ^        
remote:        ../src/binding.cpp: In function ‘void ImportedCallback(const v8::FunctionCallbackInfo<v8::Value>&)’:        
remote:        ../src/binding.cpp:365:35: warning: ‘void node::FatalException(const v8::TryCatch&)’ is deprecated (declared at /app/.node-gyp/4.1.1/src/node.h:282): Use FatalException(isolate, ...) [-Wdeprecated-declarations]        
remote:        node::FatalException(try_catch);        
remote:        ^        
remote:        make: *** [Release/obj.target/binding/src/binding.o] Error 1        
remote:        make: Leaving directory `/tmp/build_6cdc6062f746279677e20658a46a9cc8/node_modules/gulp-sass/node_modules/node-sass/build'        
remote:        gyp ERR! build error        
remote:        gyp ERR! stack Error: `make` failed with exit code: 2        
remote:        gyp ERR! stack     at ChildProcess.onExit (/tmp/build_6cdc6062f746279677e20658a46a9cc8/node_modules/gulp-sass/node_modules/node-sass/node_modules/pangyp/lib/build.js:272:23)        
remote:        gyp ERR! stack     at emitTwo (events.js:87:13)        
remote:        gyp ERR! stack     at ChildProcess.emit (events.js:172:7)        
remote:        gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)        
remote:        gyp ERR! System Linux 3.13.0-66-generic        
remote:        gyp ERR! command "/tmp/build_6cdc6062f746279677e20658a46a9cc8/.heroku/node/bin/node" "/tmp/build_6cdc6062f746279677e20658a46a9cc8/node_modules/gulp-sass/node_modules/node-sass/node_modules/pangyp/bin/node-gyp" "rebuild"        
remote:        gyp ERR! cwd /tmp/build_6cdc6062f746279677e20658a46a9cc8/node_modules/gulp-sass/node_modules/node-sass        
remote:        gyp ERR! node -v v4.1.1        
remote:        gyp ERR! pangyp -v v2.3.3        
remote:        gyp ERR! not ok        
remote:        Build failed        
remote:                
remote:        > city-as-a-campus@1.0.0 postinstall /tmp/build_6cdc6062f746279677e20658a46a9cc8        
remote:        > gulp --gulpfile client/gulpfile.js production        
remote:                
remote:        [19:23:33] Working directory changed to /tmp/build_6cdc6062f746279677e20658a46a9cc8/client        
remote:        /tmp/build_6cdc6062f746279677e20658a46a9cc8/node_modules/gulp-sass/node_modules/node-sass/lib/index.js:22        
remote:        throw new Error('`libsass` bindings not found. Try reinstalling `node-sass`?');        
remote:        ^        
remote:                
remote:        Error: `libsass` bindings not found. Try reinstalling `node-sass`?        
remote:        at getBinding (/tmp/build_6cdc6062f746279677e20658a46a9cc8/node_modules/gulp-sass/node_modules/node-sass/lib/index.js:22:11)        
remote:        at Object.<anonymous> (/tmp/build_6cdc6062f746279677e20658a46a9cc8/node_modules/gulp-sass/node_modules/node-sass/lib/index.js:188:23)        
remote:        at Module._compile (module.js:434:26)        
remote:        at Object.Module._extensions..js (module.js:452:10)        
remote:        at Module.load (module.js:355:32)        
remote:        at Function.Module._load (module.js:310:12)        
remote:        at Module.require (module.js:365:17)        
remote:        at require (module.js:384:17)        
remote:        at Object.<anonymous> (/tmp/build_6cdc6062f746279677e20658a46a9cc8/node_modules/gulp-sass/index.js:3:17)        
remote:        at Module._compile (module.js:434:26)        
remote:                
remote:        npm ERR! Linux 3.13.0-66-generic        
remote:        npm ERR! argv "/tmp/build_6cdc6062f746279677e20658a46a9cc8/.heroku/node/bin/node" "/tmp/build_6cdc6062f746279677e20658a46a9cc8/.heroku/node/bin/npm" "install" "--unsafe-perm" "--userconfig" "/tmp/build_6cdc6062f746279677e20658a46a9cc8/.npmrc"        
remote:        npm ERR! node v4.1.1        
remote:        npm ERR! npm  v2.1.18        
remote:        npm ERR! code ELIFECYCLE        
remote:        npm ERR! city-as-a-campus@1.0.0 postinstall: `gulp --gulpfile client/gulpfile.js production`        
remote:        npm ERR! Exit status 1        
remote:        npm ERR!        
remote:        npm ERR! Failed at the city-as-a-campus@1.0.0 postinstall script 'gulp --gulpfile client/gulpfile.js production'.        
remote:        npm ERR! This is most likely a problem with the city-as-a-campus package,        
remote:        npm ERR! not with npm itself.        
remote:        npm ERR! Tell the author that this fails on your system:        
remote:        npm ERR!     gulp --gulpfile client/gulpfile.js production        
remote:        npm ERR! You can get their info via:        
remote:        npm ERR!     npm owner ls city-as-a-campus        
remote:        npm ERR! There is likely additional logging output above.        
remote:                
remote:        npm ERR! Please include the following file with any support request:        
remote:        npm ERR!     /tmp/build_6cdc6062f746279677e20658a46a9cc8/npm-debug.log        
remote: 
remote: -----> Build failed        
remote:                
remote:        We're sorry this build is failing! You can troubleshoot common issues here:        
remote:        https://devcenter.heroku.com/articles/troubleshooting-node-deploys        
remote:                
remote:        If you're stuck, please submit a ticket so we can help:        
remote:        https://help.heroku.com/        
remote:                
remote:        Love,        
remote:        Heroku        
remote:                
remote: 
remote:  !     Push rejected, failed to compile Node.js app        
remote: 
remote: Verifying deploy...        
remote: 
remote: !   Push rejected to still-tor-9977.        
remote: 
To https://git.heroku.com/still-tor-9977.git
 ! [remote rejected] heroku-matthew -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/still-tor-9977.git'
chadwhitacre commented 8 years ago

Looks like we're trying to install an ancient version of node-sass, 2.1.1, which has no binary available, and doesn't compile.

chadwhitacre commented 8 years ago

ancient

Well, old, at least. :-)

Current version is 3.4.2.

chadwhitacre commented 8 years ago

I don't see node-sass specified directly in either of our package.jsons. Where is it coming from? Can we specify a newer version?

chadwhitacre commented 8 years ago

It comes from gulp-sass.

npm ls

chadwhitacre commented 8 years ago

Okay! With f3d2480f3ce1ee5d9163500c159eb9fa7e7d97b9, I can at least get slug compilation to complete:

remote:        Using pundit 1.0.1
remote:        Using bundler 1.9.7
remote:        Using tilt 1.4.1
remote:        Using sprockets 2.12.3
remote:        Using sprockets-rails 2.2.4
remote:        Using rails 4.2.1
remote:        Using rails_serve_static_assets 0.0.4
remote:        Using rails_stdout_logging 0.0.3
remote:        Using rails_12factor 0.0.3
remote:        Using rdoc 4.2.0
remote:        Using sass 3.4.13
remote:        Using sass-rails 5.0.1
remote:        Using sdoc 0.4.1
remote:        Using textacular 3.2.2
remote:        Using turbolinks 2.5.3
remote:        Using uglifier 2.7.1
remote:        Bundle complete! 21 Gemfile dependencies, 62 gems now installed.
remote:        Gems in the groups development and test were not installed.
remote:        Bundled gems are installed into ./vendor/bundle.
remote:        Bundle completed (0.38s)
remote:        Cleaning up the bundler cache.
remote: -----> Preparing app for Rails asset pipeline
remote:        Running: rake assets:precompile
remote:        Asset precompilation completed (2.10s)
remote:        Cleaning assets
remote:        Running: rake assets:clean
remote:
remote: ###### WARNING:
remote:        You have not declared a Ruby version in your Gemfile.
remote:        To set your Ruby version add this line to your Gemfile:
remote:        ruby '2.0.0'
remote:        # See https://devcenter.heroku.com/articles/ruby-versions for more information.
remote:
remote:
remote: -----> Discovering process types
remote:        Procfile declares types     -> web
remote:        Default types for buildpack -> console, rake, worker
remote:
remote: -----> Compressing... done, 46.7MB
remote: -----> Launching... done, v14
remote:        https://still-tor-9977.herokuapp.com/ deployed to Heroku
remote:
remote: Verifying deploy... done.
To https://git.heroku.com/still-tor-9977.git
 + 24472ae...f3d2480 heroku-matthew -> master (forced update)
$

screen shot 2015-11-30 at 2 46 45 pm

chadwhitacre commented 8 years ago

However, I'm still not seeing the assets needed for the homepage to render:

screen shot 2015-11-30 at 2 47 35 pm

chadwhitacre commented 8 years ago

What should I expect to see in public/?

$ heroku run ls -FGl public
Running ls -FGl public on still-tor-9977... up, run.7716
total 108
-rw------- 1 u16623 16724 Nov 30 19:44 app.min.css
-rw------- 1 u16623 47889 Nov 30 19:44 app.min.js
drwx------ 2 u16623  4096 Nov 27 19:31 assets/
drwx------ 2 u16623  4096 Nov 30 19:44 dashboard/
drwx------ 5 u16623  4096 Nov 30 19:44 explore/
drwx------ 3 u16623  4096 Nov 30 19:44 home/
-rw------- 1 u16623   737 Nov 30 19:44 index.html
drwx------ 3 u16623  4096 Nov 30 19:44 opportunity-instances/
drwx------ 6 u16623  4096 Nov 30 19:44 shared/
-rw------- 1 u16623 11084 Nov 30 19:44 vendors.min.js
$
chadwhitacre commented 8 years ago

Uncaught ReferenceError: angular is not defined

screen shot 2015-11-30 at 2 50 34 pm

chadwhitacre commented 8 years ago

Something borked in tasks.JS_VENDORS?

chadwhitacre commented 8 years ago

/me upgrades his local Node.js from 0.10.18 to 4.1.1.

chadwhitacre commented 8 years ago

Looks like js-vendors is supposed to result in a file at vendors.min.js. The file does exist. Is it correct?

screen shot 2015-11-30 at 2 59 25 pm

chadwhitacre commented 8 years ago

Looks like the dependencies specified in client/package.json aren't being installed anywhere, let alone in client/node_modules, where the js-vendors task looks for them.

$ heroku run ls -FGl client
Running ls -FGl client on still-tor-9977... up, run.4821
total 12
drwx------ 8 u11024 4096 Nov 30 19:44 app/
-rw------- 1 u11024 2640 Nov 30 19:44 gulpfile.js
-rw------- 1 u11024  442 Nov 30 19:44 package.json
$ heroku run ls -FGl node_modules
Running ls -FGl node_modules on still-tor-9977... up, run.9126
total 40
drwx------ 6 u59143 4096 Nov 30 19:44 gulp/
drwx------ 3 u59143 4096 Nov 30 19:44 gulp-concat/
drwx------ 4 u59143 4096 Nov 30 19:44 gulp-cssmin/
drwx------ 3 u59143 4096 Nov 30 19:44 gulp-minify-css/
drwx------ 3 u59143 4096 Nov 30 19:44 gulp-ng-annotate/
drwx------ 3 u59143 4096 Nov 30 19:44 gulp-rename/
drwx------ 3 u59143 4096 Nov 30 19:44 gulp-sass/
drwx------ 3 u59143 4096 Nov 30 19:44 gulp-sourcemaps/
drwx------ 4 u59143 4096 Nov 30 19:44 gulp-uglify/
drwx------ 3 u59143 4096 Nov 30 19:44 run-sequence/
$
chadwhitacre commented 8 years ago

Is it correct?

No. It doesn't contain angular. It does define Modernizr, because we've vendored that in, because it's unavailable via npm (see https://github.com/saxifrage/cityasacampus/pull/319#discussion_r43558855).

chadwhitacre commented 8 years ago

Blam. :-)

screen shot 2015-11-30 at 3 23 41 pm

chadwhitacre commented 8 years ago

I'm writing up docs for the README.

dmtroyer commented 8 years ago

@whit537 your comment regarding modernizr made me wonder if we could take a better approach to managing some of the dependencies that are just thrown in the client/app/shared folder like bourbon, neat and modernizr. NPM can handle github urls for dependencies if a current version isn't being hosted by npmjs.com. NPM could also run the build scripts for modernizr.

Anyhow, maybe just tag it as tech debt and don't worry about it for the mvp.

chadwhitacre commented 8 years ago

@dmtroyer Reticketed as #359! :-)

chadwhitacre commented 8 years ago

Alright @dmtroyer @MatthewVita, ready for review! :-)

chadwhitacre commented 8 years ago

I'm reviewing local dev deployment ...

chadwhitacre commented 8 years ago

I think there are some other changes we should make to local dev deployment, but they're out of scope for this PR. Reticketed as #360.

chadwhitacre commented 8 years ago

This PR breaks the scripts in dev. I'm going to fix those here to remove a reason not to merge this :-), though I think we should change them (#360).

chadwhitacre commented 8 years ago

Hmm ... I ran dev/src/install.sh against a clean DigitalOcean droplet, and it appears to have completed successfully, though I can't access the app server externally, I believe because it's bound to localhost.

chadwhitacre commented 8 years ago

[I]t appears to have completed successfully, though I can't access the app server externally, I believe because it's bound to localhost.

I think I'm gonna consider that good enough for this PR. S'okay, @MatthewVita?

MatthewVita commented 8 years ago

@whit537 thanks for your patience and great work.

Hmm ... I ran dev/src/install.sh against a clean DigitalOcean droplet, and it appears to have completed successfully, though I can't access the app server externally, I believe because it's bound to localhost.

Just tried it on a fresh EC2 instance and the following worked:

ubuntu@ip-172-31-34-97:~/cityasacampus/dev/src$ rails s & sleep 3 && wget localhost:3000 && cat index.html #spits out HTML

ubuntu@ip-172-31-34-97:~/cityasacampus/dev/src$ rails s & sleep 3 && wget localhost:3000/topics.json && cat topics.json #spits out JSON from GET endpoint

I'm going to merge now. My only comment was on how you did the comments in package.json... according to http://stackoverflow.com/a/14221781 we should be able to use the key "//" to comment in package.json, but it didn't work :(.

I also ripped out the old rake tasks here: hhttps://github.com/saxifrage/cityasacampus/commit/485a2996588d5329a4acb770b9dab0eaae6d6b37

chadwhitacre commented 8 years ago

My only comment was on how you did the comments in package.json... according to http://stackoverflow.com/a/14221781 we should be able to use the key "//" to comment in package.json, but it didn't work :(.

Right. See http://stackoverflow.com/questions/14221579/how-do-i-add-comments-to-package-json-for-npm-install/14221781#comment50530934_14221781.

I also ripped out the old rake tasks

wfm

I'm going to merge now.

Woo-hoo! Thank you! :-D