node.js - Run Grunt on ElasticBeanstalk -


i have node application requires grunt "build" before application can executed successfully. (runs concat/minification/revving of source code etc). i've got running on ec2 instance ssh access can ssh directory , run grunt part of deployment process. automate i'm moving application elasticbeanstalk , i'm having difficulty getting application run grunt successfully. reason move eb keep ssh keys off live servers these eb instances setup no ssh access.

there seems no official documentation available, point me in direction able achieve above? need grunt execute before application started application has files available (otherwise there'll 404).

running grunt similar running gulp, so, i'll include config below.

this inside .ebextensions folder @ root of project, named 01run.config. can have multiple config files, run in alphabetical order (hence 01 @ beginning.)

this instructs process run these commands in order, again, it's done in alphabetical order, named them accordingly.

commands:   01get_sudo:     command: echo defaults:root \!requiretty >> /etc/sudoers   02npm_install:     command: sudo yum -y --enablerepo=epel install nodejs npm   03npm_install_bower:     command: sudo npm install -g bower   04npm_install_gulp:     command: sudo npm install -g gulp   05yum_install_git:     command: sudo yum -y --enablerepo=epel install git container_commands:   01bower_install:     command: sudo bower install --allow-root   02gulp_sass:     command: sudo gulp sass 
  1. get sudo access
  2. install node.js , npm yum
  3. install bower (my gulp process needed bower)
  4. install gulp
  5. install git (needed bower)
  6. i run 2 container commands, happen after npm install , before npm start:
    1. bower install
    2. gulp sass

in case, you'd remove bower , git installs, install grunt-cli, , run grunt.


since doing this, i've removed need above process doing front before deploying , committing built files git repository. @ least learning experience gives me more control on ec2 instances deployed beanstalk.


Comments

Popular posts from this blog

How to provide Authorization & Authentication using Asp.net, C#? -

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

android - Pass an Serializable object in AIDL -