Guest User

Untitled

a guest
Dec 6th, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. {
  2. "name": "...",
  3. "version": "1.0.0",
  4. "description": "...",
  5. "scripts": {
  6. "prestart": "node ./node_modules/knex/lib/bin/cli.js migrate:latest",
  7. "poststart": "..."
  8. }
  9. }
  10.  
  11. knex.migrate.latest([config])
  12.  
  13. container_commands:
  14. 01_node_binary:
  15. command: "ln -sf `ls -td /opt/elasticbeanstalk/node-install/node-* | head -1`/bin/node /bin/node"
  16. leader_only: true
  17. 02_npm_binary:
  18. command: "ln -sf `ls -td /opt/elasticbeanstalk/node-install/node-* | head -1`/bin/npm /bin/npm"
  19. leader_only: true
  20. 03_migrate_db:
  21. command: "sudo DB_HOST=${DB_HOST} DB_PORT=${DB_PORT} DB_NAME=${DB_NAME} DB_USER=${DB_USER} DB_PASSWORD=${DB_PASSWORD} npm run db:migration:run"
  22. leader_only: true
  23.  
  24. ...
  25. scripts: {
  26. "db:migration:run": "knex migrate:latest"
  27. }
  28.  
  29. "scripts": {
  30. "start": "npx knex migrate:latest && node server.js"
  31. }
Add Comment
Please, Sign In to add comment