node.js - how to run an node npm script in deployment hook in codeship -


as part of codeship heroku deployment hook, i'd run database updates/migrations before app starts. how can trigger npm script or command line script in heroku using codeship deployment step?

i tried putting in part of npm start script seems have trouble connecting database then. e.g.

from package.json

"start": "./node_modules/.bin/knex migrate:latest && node server.js"

if add custom deploy script codeship after heroku deployment step, should run after app running, you'll have database access. have access heroku toolkit, should able run: heroku run --app your_app_name -- ./node_modules/.bin/knex migrate:latest


Comments

Popular posts from this blog

javascript - Bootstrap Popover: iOS Safari strange behaviour -

Magento/PHP - Get phones on all members in a customer group -

session - Logging Out Using PHP -