部署AWS Beanstalk之后执行命令 [英] Execute command after deploy AWS Beanstalk
问题描述
node_modules / .bin / some:没有这样的文件或目录
)。部署后如何执行命令谢谢。我发现以下解决方案
我添加到beanstalk配置下一个命令:
命令:
create_post_dir:
命令:mkdir / opt / elasticbeanstalk /钩子/ appdeploy / post
ignoreErrors:true
文件:
/opt/elasticbeanstalk/hooks/appdeploy/post/some_job.sh:
模式:000755
所有者:root
组:root
内容:|
#!/ usr / bin / env bash
/ var / app / current
npm运行some_script
此命令为挂钩脚本创建(如果不存在)文件夹,并添加bash脚本。此文件夹中的脚本仅在安装npm后执行,这对我的问题非常重要。
感谢这个人 http://junkheap.net/blog/2013/05/20/elastic-beanstalk-post-deployment-scripts/
I have problem with execute command after deploy, i have some node.js project and script, this script use some bin from node_modules, if i write my command for script in .ebextensions/.config he execute before npm install and return error ("node_modules/.bin/some": No such file or directory
). How i can execute command after deploy. Thanks.
I found the following solution
I add to beanstalk config next command:
commands:
create_post_dir:
command: "mkdir /opt/elasticbeanstalk/hooks/appdeploy/post"
ignoreErrors: true
files:
"/opt/elasticbeanstalk/hooks/appdeploy/post/some_job.sh":
mode: "000755"
owner: root
group: root
content: |
#!/usr/bin/env bash
/var/app/current
npm run some_script
This commands create(if not exist) folder for post-hooks scripts and adds bash script. Scripts in this folders execute only after npm install, this very important for my problem.
Thanks to this guy http://junkheap.net/blog/2013/05/20/elastic-beanstalk-post-deployment-scripts/
这篇关于部署AWS Beanstalk之后执行命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!