{"action":"created","issue":{"url":"https://api.github.com/repos/tgriesser/knex/issues/678","labels_url":"https://api.github.com/repos/tgriesser/knex/issues/678/labels{/name}","comments_url":"https://api.github.com/repos/tgriesser/knex/issues/678/comments","events_url":"https://api.github.com/repos/tgriesser/knex/issues/678/events","html_url":"https://github.com/tgriesser/knex/issues/678","id":57278343,"number":678,"title":"Running knex migrations on AWS ElasticBeanStalk","user":{"login":"gmcdowell","id":10100952,"avatar_url":"https://avatars.githubusercontent.com/u/10100952?v=3","gravatar_id":"","url":"https://api.github.com/users/gmcdowell","html_url":"https://github.com/gmcdowell","followers_url":"https://api.github.com/users/gmcdowell/followers","following_url":"https://api.github.com/users/gmcdowell/following{/other_user}","gists_url":"https://api.github.com/users/gmcdowell/gists{/gist_id}","starred_url":"https://api.github.com/users/gmcdowell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gmcdowell/subscriptions","organizations_url":"https://api.github.com/users/gmcdowell/orgs","repos_url":"https://api.github.com/users/gmcdowell/repos","events_url":"https://api.github.com/users/gmcdowell/events{/privacy}","received_events_url":"https://api.github.com/users/gmcdowell/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-02-11T05:30:57Z","updated_at":"2015-04-23T16:54:43Z","closed_at":"2015-02-11T11:52:16Z","body":"Hi All,\r\n\r\nJust wonder if anyone has solved this one. Challenges faced include access to global knex & node modules among others.\r\n\r\nAny suggestions/snippets appreciated."},"comment":{"url":"https://api.github.com/repos/tgriesser/knex/issues/comments/95652258","html_url":"https://github.com/tgriesser/knex/issues/678#issuecomment-95652258","issue_url":"https://api.github.com/repos/tgriesser/knex/issues/678","id":95652258,"user":{"login":"TehNrd","id":1007085,"avatar_url":"https://avatars.githubusercontent.com/u/1007085?v=3","gravatar_id":"","url":"https://api.github.com/users/TehNrd","html_url":"https://github.com/TehNrd","followers_url":"https://api.github.com/users/TehNrd/followers","following_url":"https://api.github.com/users/TehNrd/following{/other_user}","gists_url":"https://api.github.com/users/TehNrd/gists{/gist_id}","starred_url":"https://api.github.com/users/TehNrd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TehNrd/subscriptions","organizations_url":"https://api.github.com/users/TehNrd/orgs","repos_url":"https://api.github.com/users/TehNrd/repos","events_url":"https://api.github.com/users/TehNrd/events{/privacy}","received_events_url":"https://api.github.com/users/TehNrd/received_events","type":"User","site_admin":false},"created_at":"2015-04-23T16:54:43Z","updated_at":"2015-04-23T16:54:43Z","body":"Thanks. If anyone else comes across this you can probably accomplish this with [container commands](http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/customize-containers-ec2.html#customize-containers-format-container_commands). Disclaimer I haven't actually tried the script below but it should work:\r\n\r\n```\r\n{\r\n\t\"container_commands\":{\r\n\t\t\"01_enable_rootaccess\":{\r\n\t\t\t\"command\": \"echo Defaults:root \\!requiretty >> /etc/sudoers\",\r\n\t\t},\r\n\t\t\"02_install_knex\":{\r\n\t\t\t\"command\": \"sudo /opt/elasticbeanstalk/node-install/node-v0.12.0-linux-x64/bin/npm install -g knex\",\r\n\t\t\t\"leader_only\": true\r\n\t\t}\r\n\t\t\"03_database_migrations\":{\r\n\t\t\t\"command\": \"knex migrate:latest\",\r\n\t\t\t\"leader_only\": true\r\n\t\t}\r\n\t}\r\n}\r\n```"}}