M
M
Mikhail Bazhenov2015-05-16 15:06:12
Amazon Web Services
Mikhail Bazhenov, 2015-05-16 15:06:12

In AWS Elastic Beanstalk, how can I make the grunt command run when the application starts?

Hey!
When deploying an application to instances, how to make sure that
a) Grunt is installed if it is not installed
b) Run grunt
tasks Specify in package.json?

"scripts": {
"run": "grunt db:migrate"
}

For example, if you deploy via pm2 to ordinary virtual servers, then you can specify which commands to run and what to do .. And then just download the code and that's it ..

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Mikhail Bazhenov, 2015-05-17
@benign

You can also do this.
Set up the start command as "npm start" and then in package.json

"scripts": {
"start": "grunt db:migrate && grunt db:seed && node server.js"
}

D
Denis Malinochkin, 2015-05-16
@DiAsCrafts

If I understood correctly (did not work with Amazon), then perhaps this will help:

"scripts": {
  "preinstall": "npm i -g grunt-cli && npm i grunt && grunt db:migrate"
}

A little more . The documentation says that this use of preinstall is an ANTIPATTERN .
You can also try using package-script .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question